Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 19 commits
  • 26 files changed
  • 0 commit comments
  • 2 contributors
Showing with 1,059 additions and 2 deletions.
  1. +2 −1  .gitignore
  2. +8 −0 AdvancedLogicElements/build.xml
  3. +5 −0 AdvancedLogicElements/manifest.mf
  4. +45 −0 AdvancedLogicElements/nbproject/build-impl.xml
  5. +8 −0 AdvancedLogicElements/nbproject/genfiles.properties
  6. +2 −0  AdvancedLogicElements/nbproject/project.properties
  7. +38 −0 AdvancedLogicElements/nbproject/project.xml
  8. +1 −0  AdvancedLogicElements/nbproject/suite.properties
  9. +1 −0  AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Bundle.properties
  10. +36 −0 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Nand/Nand.java
  11. +12 −0 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Nand/element_info.xml
  12. +6 −0 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Nand/graphic.svg
  13. +36 −0 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Nor/Nor.java
  14. +12 −0 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Nor/element_info.xml
  15. +6 −0 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Nor/graphic.svg
  16. +42 −0 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Xnor/Xnor.java
  17. +12 −0 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Xnor/element_info.xml
  18. +6 −0 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Xnor/graphic.svg
  19. +41 −0 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Xor/Xor.java
  20. +12 −0 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Xor/element_info.xml
  21. +5 −0 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Xor/graphic.svg
  22. +182 −0 AdvancedLogicElements/test/unit/src/net/unikernel/bummel/advanced_logic_elements/NandTest.java
  23. +183 −0 AdvancedLogicElements/test/unit/src/net/unikernel/bummel/advanced_logic_elements/NorTest.java
  24. +177 −0 AdvancedLogicElements/test/unit/src/net/unikernel/bummel/advanced_logic_elements/XnorTest.java
  25. +178 −0 AdvancedLogicElements/test/unit/src/net/unikernel/bummel/advanced_logic_elements/XorTest.java
  26. +3 −1 nbproject/project.properties
View
3  .gitignore
@@ -45,4 +45,5 @@ build/
ehthumbs.db
Icon?
Thumbs.db
-/SvgWrapper/nbproject/private/
+/SvgWrapper/nbproject/private/
+/AdvancedLogicElements/nbproject/private/
View
8 AdvancedLogicElements/build.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
+<!-- for some information on what you could do (e.g. targets to override). -->
+<!-- If you delete this file and reopen the project it will be recreated. -->
+<project name="net.unikernel.bummel.advanced_logic_elements" default="netbeans" basedir=".">
+ <description>Builds, tests, and runs the project net.unikernel.bummel.advanced_logic_elements.</description>
+ <import file="nbproject/build-impl.xml"/>
+</project>
View
5 AdvancedLogicElements/manifest.mf
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+OpenIDE-Module: net.unikernel.bummel.advanced_logic_elements
+OpenIDE-Module-Localizing-Bundle: net/unikernel/bummel/advanced_logic_elements/Bundle.properties
+OpenIDE-Module-Specification-Version: 1.0
+
View
45 AdvancedLogicElements/nbproject/build-impl.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT ***
+*** EDIT ../build.xml INSTEAD ***
+-->
+<project name="net.unikernel.bummel.advanced_logic_elements-impl" basedir="..">
+ <fail message="Please build using Ant 1.7.1 or higher.">
+ <condition>
+ <not>
+ <antversion atleast="1.7.1"/>
+ </not>
+ </condition>
+ </fail>
+ <property file="nbproject/private/suite-private.properties"/>
+ <property file="nbproject/suite.properties"/>
+ <fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
+ <property file="${suite.dir}/nbproject/private/platform-private.properties"/>
+ <property file="${suite.dir}/nbproject/platform.properties"/>
+ <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
+ <attribute name="name"/>
+ <attribute name="value"/>
+ <sequential>
+ <property name="@{name}" value="${@{value}}"/>
+ </sequential>
+ </macrodef>
+ <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
+ <attribute name="property"/>
+ <attribute name="value"/>
+ <sequential>
+ <property name="@{property}" value="@{value}"/>
+ </sequential>
+ </macrodef>
+ <property file="${user.properties.file}"/>
+ <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
+ <nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
+ <nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
+ <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
+ <condition>
+ <not>
+ <contains string="${cluster.path.evaluated}" substring="platform"/>
+ </not>
+ </condition>
+ </fail>
+ <import file="${harness.dir}/build.xml"/>
+</project>
View
8 AdvancedLogicElements/nbproject/genfiles.properties
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=ccf29c26
+build.xml.script.CRC32=bad95746
+build.xml.stylesheet.CRC32=a56c6a5b@2.47.1
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=ccf29c26
+nbproject/build-impl.xml.script.CRC32=ea876d01
+nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.47.1
View
2  AdvancedLogicElements/nbproject/project.properties
@@ -0,0 +1,2 @@
+javac.source=1.7
+javac.compilerargs=-Xlint -Xlint:-serial
View
38 AdvancedLogicElements/nbproject/project.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.apisupport.project</type>
+ <configuration>
+ <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
+ <code-name-base>net.unikernel.bummel.advanced_logic_elements</code-name-base>
+ <suite-component/>
+ <module-dependencies>
+ <dependency>
+ <code-name-base>net.unikernel.bummel.project_model</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>1.0</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.modules.nbjunit</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>1</release-version>
+ <specification-version>1.72.2</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.openide.util.lookup</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>8.11.1</specification-version>
+ </run-dependency>
+ </dependency>
+ </module-dependencies>
+ <public-packages/>
+ </data>
+ </configuration>
+</project>
View
1  AdvancedLogicElements/nbproject/suite.properties
@@ -0,0 +1 @@
+suite.dir=${basedir}/..
View
1  AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Bundle.properties
@@ -0,0 +1 @@
+OpenIDE-Module-Name=AdvancedLogicElements
View
36 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Nand/Nand.java
@@ -0,0 +1,36 @@
+package net.unikernel.bummel.advanced_logic_elements.Nand;
+
+import java.util.Map;
+import net.unikernel.bummel.project_model.api.BasicElement;
+import net.unikernel.bummel.project_model.api.Element;
+import org.openide.util.lookup.ServiceProvider;
+
+/**
+ *
+ * @author Roma
+ */
+@ServiceProvider(service=BasicElement.class)
+@Element.ElementData(dataFile="element_info.xml")
+public class Nand extends BasicElement
+{
+ public Nand()
+ {
+ super(new String[] {"input1", "input2", "output"});
+ }
+
+ @Override
+ public Map<String, Double> process(Map<String, Double> valuesOnPorts)
+ {
+ if(valuesOnPorts.get(getPorts().get(0)).compareTo(new Double(1)) == 0 && valuesOnPorts.get(getPorts().get(1)).compareTo(new Double(1)) == 0)
+ {
+ valuesOnPorts.put(getPorts().get(2), new Double(0));
+ }
+ else
+ {
+ valuesOnPorts.put(getPorts().get(2), new Double(1));
+ }
+ valuesOnPorts.put(getPorts().get(0), new Double(0));
+ valuesOnPorts.put(getPorts().get(1), new Double(0));
+ return valuesOnPorts;
+ }
+}
View
12 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Nand/element_info.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE element_info PUBLIC '-//Unikernel//DTD BUMMEL Element Info 1.0//EN' 'http://cloud.github.com/downloads/Uko/BUMMEL/element-info10.dtd'>
+<element_info>
+ <images>
+ <graphics state="0" filename="graphic.svg" />
+ </images>
+ <ports>
+ <port name="input1" direction="left" offset="0.5" indent="0" />
+ <port name="input2" direction="left" offset="-0.5" indent="0" />
+ <port name="output" direction="right" offset="0" indent="0" />
+ </ports>
+</element_info>
View
6 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Nand/graphic.svg
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <path d="M2,2 H 15 C36,2 36,32 15,32 H 2 Z" style="stroke: #000000; stroke-width: 3; fill: none" />
+ <circle cx="35" cy="17" r="3" style="stroke: #000000; stroke-width: 2; fill: none" />
+</svg>
View
36 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Nor/Nor.java
@@ -0,0 +1,36 @@
+package net.unikernel.bummel.advanced_logic_elements.Nor;
+
+import java.util.Map;
+import net.unikernel.bummel.project_model.api.BasicElement;
+import net.unikernel.bummel.project_model.api.Element;
+import org.openide.util.lookup.ServiceProvider;
+
+/**
+ *
+ * @author Roma
+ */
+@ServiceProvider(service=BasicElement.class)
+@Element.ElementData(dataFile="element_info.xml")
+public class Nor extends BasicElement
+{
+ public Nor()
+ {
+ super(new String[]{"input1", "input2", "output"});
+ }
+
+ @Override
+ public Map<String, Double> process(Map<String, Double> valuesOnPorts)
+ {
+ if(valuesOnPorts.get(getPorts().get(0)).compareTo(new Double(0)) == 0 && valuesOnPorts.get(getPorts().get(1)).compareTo(new Double(0)) == 0)
+ {
+ valuesOnPorts.put(getPorts().get(2), new Double(1));
+ }
+ else
+ {
+ valuesOnPorts.put(getPorts().get(2), new Double(0));
+ }
+ valuesOnPorts.put(getPorts().get(0), new Double(0));
+ valuesOnPorts.put(getPorts().get(1), new Double(0));
+ return valuesOnPorts;
+ }
+}
View
12 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Nor/element_info.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE element_info PUBLIC '-//Unikernel//DTD BUMMEL Element Info 1.0//EN' 'http://cloud.github.com/downloads/Uko/BUMMEL/element-info10.dtd'>
+<element_info>
+ <images>
+ <graphics state="0" filename="graphic.svg" />
+ </images>
+ <ports>
+ <port name="input1" direction="left" offset="0.5" indent="0" />
+ <port name="input2" direction="left" offset="-0.5" indent="0" />
+ <port name="output" direction="right" offset="0" indent="0" />
+ </ports>
+</element_info>
View
6 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Nor/graphic.svg
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <path d="M15,2 Q25,3 35,16 Q25,31 12,32 H3 Q10,16 2,2 Z" style="stroke: #000000; stroke-width: 3; fill:none" />
+ <circle cx="39" cy="16" r="3" style="stroke: #000000; stroke-width: 2; fill:none" />
+</svg>
View
42 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Xnor/Xnor.java
@@ -0,0 +1,42 @@
+package net.unikernel.bummel.advanced_logic_elements.Xnor;
+
+import java.util.Map;
+import net.unikernel.bummel.project_model.api.BasicElement;
+import net.unikernel.bummel.project_model.api.Element;
+import org.openide.util.lookup.ServiceProvider;
+
+/**
+ *
+ * @author Roma
+ */
+@ServiceProvider(service=BasicElement.class)
+@Element.ElementData(dataFile="element_info.xml")
+public class Xnor extends BasicElement
+{
+ public Xnor()
+ {
+ super(new String[]{"input1", "input2", "output"});
+ }
+
+ @Override
+ public Map<String, Double> process(Map<String, Double> valuesOnPorts)
+ {
+ if(valuesOnPorts.get(getPorts().get(0)).compareTo(new Double(0)) == 0 && valuesOnPorts.get(getPorts().get(1)).compareTo(new Double(0)) == 0)
+ {
+ valuesOnPorts.put(getPorts().get(2), new Double(1));
+ }
+ else
+ if(valuesOnPorts.get(getPorts().get(0)).compareTo(new Double(1)) == 0 && valuesOnPorts.get(getPorts().get(1)).compareTo(new Double(1)) == 0)
+ {
+ valuesOnPorts.put(getPorts().get(2), new Double(1));
+ }
+ else
+ {
+ valuesOnPorts.put(getPorts().get(2), new Double(0));
+ }
+ valuesOnPorts.put(getPorts().get(0), new Double(0));
+ valuesOnPorts.put(getPorts().get(1), new Double(0));
+ return valuesOnPorts;
+ }
+
+}
View
12 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Xnor/element_info.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE element_info PUBLIC '-//Unikernel//DTD BUMMEL Element Info 1.0//EN' 'http://cloud.github.com/downloads/Uko/BUMMEL/element-info10.dtd'>
+<element_info>
+ <images>
+ <graphics state="0" filename="graphic.svg" />
+ </images>
+ <ports>
+ <port name="input1" direction="left" offset="0.5" indent="0" />
+ <port name="input2" direction="left" offset="-0.5" indent="0" />
+ <port name="output" direction="right" offset="0" indent="0" />
+ </ports>
+</element_info>
View
6 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Xnor/graphic.svg
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <path d="M2,1 Q13,16 2,33 M22,2 Q32,3 42,16 Q32,31 19,32 H10 Q17,16 9,2 Z" style="stroke: #000000; stroke-width: 3; fill:none" />
+ <circle cx="46" cy="16" r="3" style="stroke: #000000; stroke-width: 2; fill: none" />
+</svg>
View
41 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Xor/Xor.java
@@ -0,0 +1,41 @@
+package net.unikernel.bummel.advanced_logic_elements.Xor;
+
+import java.util.Map;
+import net.unikernel.bummel.project_model.api.BasicElement;
+import net.unikernel.bummel.project_model.api.Element.ElementData;
+import org.openide.util.lookup.ServiceProvider;
+
+/**
+ *
+ * @author Roma
+ */
+@ServiceProvider(service=BasicElement.class)
+@ElementData(dataFile="element_info.xml")
+public class Xor extends BasicElement
+{
+ public Xor()
+ {
+ super(new String[]{"input1", "input2", "output"});
+ }
+ @Override
+ public Map<String, Double> process(Map<String, Double> valuesOnPorts)
+ {
+ if(valuesOnPorts.get(getPorts().get(0)).compareTo(new Double(1)) == 0 && valuesOnPorts.get(getPorts().get(1)).compareTo(new Double(0)) == 0)
+ {
+ valuesOnPorts.put(getPorts().get(2), new Double(1));
+ }
+ else
+ if(valuesOnPorts.get(getPorts().get(0)).compareTo(new Double(0)) == 0 && valuesOnPorts.get(getPorts().get(1)).compareTo(new Double(1)) == 0)
+ {
+ valuesOnPorts.put(getPorts().get(2), new Double(1));
+ }
+ else
+ {
+ valuesOnPorts.put(getPorts().get(2), new Double(0));
+ }
+ valuesOnPorts.put(getPorts().get(0), 0.);
+ valuesOnPorts.put(getPorts().get(1), 0.);
+ return valuesOnPorts;
+ }
+
+}
View
12 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Xor/element_info.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE element_info PUBLIC '-//Unikernel//DTD BUMMEL Element Info 1.0//EN' 'http://cloud.github.com/downloads/Uko/BUMMEL/element-info10.dtd'>
+<element_info>
+ <images>
+ <graphics state="0" filename="graphic.svg" />
+ </images>
+ <ports>
+ <port name="input1" direction="left" offset="0.5" indent="0" />
+ <port name="input2" direction="left" offset="-0.5" indent="0" />
+ <port name="output" direction="right" offset="0" indent="0" />
+ </ports>
+</element_info>
View
5 AdvancedLogicElements/src/net/unikernel/bummel/advanced_logic_elements/Xor/graphic.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <path d="M2,1 Q13,16 2,33 M22,2 Q32,3 42,16 Q32,31 19,32 H10 Q17,16 9,2 Z" style="stroke: #000000; stroke-width: 3; fill:none" />
+</svg>
View
182 AdvancedLogicElements/test/unit/src/net/unikernel/bummel/advanced_logic_elements/NandTest.java
@@ -0,0 +1,182 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package net.unikernel.bummel.advanced_logic_elements;
+
+import java.util.Map;
+import java.util.TreeMap;
+import org.junit.*;
+import static org.junit.Assert.*;
+import net.unikernel.bummel.advanced_logic_elements.Nand.Nand;
+
+/**
+ *
+ * @author Roma
+ */
+public class NandTest
+{
+
+ public NandTest()
+ {
+ }
+
+ @BeforeClass
+ public static void setUpClass() throws Exception
+ {
+ }
+
+ @AfterClass
+ public static void tearDownClass() throws Exception
+ {
+ }
+ Nand instance;
+ @Before
+ public void setUp()
+ {
+ instance = new Nand();
+ }
+
+ @After
+ public void tearDown()
+ {
+ instance = null;
+ }
+ @Test
+ public void testProcess000()
+ {
+ System.out.println("nand_process 000");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",0.);
+ valuesOnPorts.put("input2",0.);
+ valuesOnPorts.put("output",0.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 1.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess001()
+ {
+ System.out.println("nand_process 001");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",0.);
+ valuesOnPorts.put("input2",0.);
+ valuesOnPorts.put("output",1.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 1.);
+ Map result = instance.process(valuesOnPorts);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ assertEquals(expResult, result);
+ }
+ @Test
+ public void testProcess010()
+ {
+ System.out.println("nand_process 010");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",0.);
+ valuesOnPorts.put("input2",1.);
+ valuesOnPorts.put("output",0.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 1.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess011()
+ {
+ System.out.println("nand_process 011");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",0.);
+ valuesOnPorts.put("input2",1.);
+ valuesOnPorts.put("output",1.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 1.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess100()
+ {
+ System.out.println("nand_process 100");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",1.);
+ valuesOnPorts.put("input2",0.);
+ valuesOnPorts.put("output",0.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 1.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess101()
+ {
+ System.out.println("nand_process 101");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",1.);
+ valuesOnPorts.put("input2",0.);
+ valuesOnPorts.put("output",1.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 1.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess110()
+ {
+ System.out.println("nand_process 110");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",1.);
+ valuesOnPorts.put("input2",1.);
+ valuesOnPorts.put("output",0.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 0.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess111()
+ {
+ System.out.println("nand_process 111");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",1.);
+ valuesOnPorts.put("input2",1.);
+ valuesOnPorts.put("output",1.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 0.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+
+}
View
183 AdvancedLogicElements/test/unit/src/net/unikernel/bummel/advanced_logic_elements/NorTest.java
@@ -0,0 +1,183 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package net.unikernel.bummel.advanced_logic_elements;
+
+import java.util.Map;
+import java.util.TreeMap;
+import org.junit.*;
+import net.unikernel.bummel.advanced_logic_elements.Nor.Nor;
+import static org.junit.Assert.*;
+
+
+/**
+ *
+ * @author Roma
+ */
+public class NorTest
+{
+
+ public NorTest()
+ {
+ }
+
+ @BeforeClass
+ public static void setUpClass() throws Exception
+ {
+ }
+
+ @AfterClass
+ public static void tearDownClass() throws Exception
+ {
+ }
+
+ Nor instance;
+ @Before
+ public void setUp()
+ {
+ instance = new Nor();
+ }
+
+ @After
+ public void tearDown()
+ {
+ instance = null;
+ }
+ @Test
+ public void testProcess000()
+ {
+ System.out.println("nor_process 000");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",0.);
+ valuesOnPorts.put("input2",0.);
+ valuesOnPorts.put("output",0.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 1.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess001()
+ {
+ System.out.println("nor_process 001");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",0.);
+ valuesOnPorts.put("input2",0.);
+ valuesOnPorts.put("output",1.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 1.);
+ Map result = instance.process(valuesOnPorts);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ assertEquals(expResult, result);
+ }
+ @Test
+ public void testProcess010()
+ {
+ System.out.println("nor_process 010");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",0.);
+ valuesOnPorts.put("input2",1.);
+ valuesOnPorts.put("output",0.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 0.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess011()
+ {
+ System.out.println("nor_process 011");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",0.);
+ valuesOnPorts.put("input2",1.);
+ valuesOnPorts.put("output",1.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 0.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess100()
+ {
+ System.out.println("nor_process 100");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",1.);
+ valuesOnPorts.put("input2",0.);
+ valuesOnPorts.put("output",0.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 0.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess101()
+ {
+ System.out.println("nor_process 101");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",1.);
+ valuesOnPorts.put("input2",0.);
+ valuesOnPorts.put("output",1.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 0.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess110()
+ {
+ System.out.println("nor_process 110");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",1.);
+ valuesOnPorts.put("input2",1.);
+ valuesOnPorts.put("output",0.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 0.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess111()
+ {
+ System.out.println("nor_process 111");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",1.);
+ valuesOnPorts.put("input2",1.);
+ valuesOnPorts.put("output",1.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 0.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+}
View
177 AdvancedLogicElements/test/unit/src/net/unikernel/bummel/advanced_logic_elements/XnorTest.java
@@ -0,0 +1,177 @@
+package net.unikernel.bummel.advanced_logic_elements;
+
+import java.util.Map;
+import java.util.TreeMap;
+import org.junit.*;
+import static org.junit.Assert.*;
+import net.unikernel.bummel.advanced_logic_elements.Xnor.Xnor;
+/**
+ *
+ * @author Roma
+ */
+public class XnorTest
+{
+
+ public XnorTest()
+ {
+ }
+
+ @BeforeClass
+ public static void setUpClass() throws Exception
+ {
+ }
+
+ @AfterClass
+ public static void tearDownClass() throws Exception
+ {
+ }
+
+ Xnor instance;
+ @Before
+ public void setUp()
+ {
+ instance = new Xnor();
+ }
+
+ @After
+ public void tearDown()
+ {
+ instance = null;
+ }
+ @Test
+ public void testProcess000()
+ {
+ System.out.println("xnor_process 000");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",0.);
+ valuesOnPorts.put("input2",0.);
+ valuesOnPorts.put("output",0.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 1.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess001()
+ {
+ System.out.println("xnor_process 001");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",0.);
+ valuesOnPorts.put("input2",0.);
+ valuesOnPorts.put("output",1.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 1.);
+ Map result = instance.process(valuesOnPorts);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ assertEquals(expResult, result);
+ }
+ @Test
+ public void testProcess010()
+ {
+ System.out.println("xnor_process 010");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",0.);
+ valuesOnPorts.put("input2",1.);
+ valuesOnPorts.put("output",0.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 0.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess011()
+ {
+ System.out.println("xnor_process 011");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",0.);
+ valuesOnPorts.put("input2",1.);
+ valuesOnPorts.put("output",1.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 0.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess100()
+ {
+ System.out.println("xnor_process 100");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",1.);
+ valuesOnPorts.put("input2",0.);
+ valuesOnPorts.put("output",0.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 0.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess101()
+ {
+ System.out.println("xnor_process 101");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",1.);
+ valuesOnPorts.put("input2",0.);
+ valuesOnPorts.put("output",1.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 0.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess110()
+ {
+ System.out.println("xnor_process 110");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",1.);
+ valuesOnPorts.put("input2",1.);
+ valuesOnPorts.put("output",0.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 1.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess111()
+ {
+ System.out.println("xnor_process 111");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",1.);
+ valuesOnPorts.put("input2",1.);
+ valuesOnPorts.put("output",1.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 1.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+}
View
178 AdvancedLogicElements/test/unit/src/net/unikernel/bummel/advanced_logic_elements/XorTest.java
@@ -0,0 +1,178 @@
+package net.unikernel.bummel.advanced_logic_elements;
+
+import java.util.Map;
+import java.util.TreeMap;
+import net.unikernel.bummel.advanced_logic_elements.Xor.Xor;
+import org.junit.*;
+import static org.junit.Assert.*;
+
+/**
+ *
+ * @author Roma
+ */
+public class XorTest
+{
+
+ public XorTest()
+ {
+ }
+
+ @BeforeClass
+ public static void setUpClass() throws Exception
+ {
+ }
+
+ @AfterClass
+ public static void tearDownClass() throws Exception
+ {
+ }
+
+ Xor instance;
+ @Before
+ public void setUp()
+ {
+ instance = new Xor();
+ }
+
+ @After
+ public void tearDown()
+ {
+ instance = null;
+ }
+ @Test
+ public void testProcess000()
+ {
+ System.out.println("xor_process 000");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",0.);
+ valuesOnPorts.put("input2",0.);
+ valuesOnPorts.put("output",0.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 0.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess001()
+ {
+ System.out.println("xor_process 001");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",0.);
+ valuesOnPorts.put("input2",0.);
+ valuesOnPorts.put("output",1.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 0.);
+ Map result = instance.process(valuesOnPorts);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ assertEquals(expResult, result);
+ }
+ @Test
+ public void testProcess010()
+ {
+ System.out.println("xor_process 010");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",0.);
+ valuesOnPorts.put("input2",1.);
+ valuesOnPorts.put("output",0.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 1.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess011()
+ {
+ System.out.println("xor_process 011");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",0.);
+ valuesOnPorts.put("input2",1.);
+ valuesOnPorts.put("output",1.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 1.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess100()
+ {
+ System.out.println("xor_process 100");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",1.);
+ valuesOnPorts.put("input2",0.);
+ valuesOnPorts.put("output",0.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 1.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess101()
+ {
+ System.out.println("xor_process 101");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",1.);
+ valuesOnPorts.put("input2",0.);
+ valuesOnPorts.put("output",1.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 1.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess110()
+ {
+ System.out.println("xor_process 110");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",1.);
+ valuesOnPorts.put("input2",1.);
+ valuesOnPorts.put("output",0.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 0.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+ @Test
+ public void testProcess111()
+ {
+ System.out.println("xor_process 111");
+ Map<String, Double> valuesOnPorts = new TreeMap<>();
+ valuesOnPorts.put("input1",1.);
+ valuesOnPorts.put("input2",1.);
+ valuesOnPorts.put("output",1.);
+ Map<String, Double> expResult= new TreeMap<>();
+ expResult.put("input1", 0.);
+ expResult.put("input2", 0.);
+ expResult.put("output", 0.);
+ Map result = instance.process(valuesOnPorts);
+ assertEquals(expResult, result);
+ System.out.println("Result output values: " + result.get("output"));
+ System.out.println("-------------------------");
+ }
+}
View
4 nbproject/project.properties
@@ -11,7 +11,9 @@ branding.token=${app.name}
modules=\
${project.net.unikernel.bummel.visual_editor}:\
${project.net.unikernel.bummel.project_model}:\
- ${project.net.unikernel.bummel.logic_elements}
+ ${project.net.unikernel.bummel.logic_elements}:\
+ ${project.net.unikernel.bummel.advanced_logic_elements}
+project.net.unikernel.bummel.advanced_logic_elements=AdvancedLogicElements
project.net.unikernel.bummel.logic_elements=LogicElements
project.net.unikernel.bummel.project_model=ProjectModel
project.net.unikernel.bummel.visual_editor=VisualEditor

No commit comments for this range

Something went wrong with that request. Please try again.