Package ca.nengo.model.impl

Examples of ca.nengo.model.impl.BasicOrigin


    if (generator == null) {
      generator = new LIFSpikeGenerator(.001f, .02f, .002f);
    }
    setGenerator(generator);

    myCurrentOrigin = new BasicOrigin(this, CURRENT, 1, Units.ACU);
    myCurrentOrigin.setValues(0, 0, new float[]{0});
    myName = name;
    myScale = scale;
    myBias = bias;
    myRadialInput = 0;
View Full Code Here


* @author Bryan Tripp
*/
public class AbstractEnsembleTest extends TestCase {

  public void testFindCommon1DOrigins() {
    Origin one = new BasicOrigin(null, "2D", 2, Units.UNK);
    Origin two = new BasicOrigin(null, "unique", 1, Units.UNK);
    Origin three = new BasicOrigin(null, "shared1", 1, Units.UNK);
    Origin four = new BasicOrigin(null, "shared2", 1, Units.UNK);
   
    List<Origin> shared = new ArrayList<Origin>(3);
    shared.add(one);
    shared.add(three);
    shared.add(four);
   
    List<Origin> notshared = new ArrayList<Origin>(4);
    notshared.add(one);
    notshared.add(three);
    notshared.add(four);
    notshared.add(two);
   
    Node[] nodes = new Node[3];
    nodes[0] = new AbstractNode("a", shared, new ArrayList<Termination>(1)) {
      private static final long serialVersionUID = 1L;

      @Override
      public void run(float startTime, float endTime)
          throws SimulationException {}

      @Override
      public void reset(boolean randomize) {}

      public Node[] getChildren() {
        return new Node[0];
      }

      public String toScript(HashMap<String, Object> scriptData) throws ScriptGenException {
        return "";
      }};   
    nodes[1] = new AbstractNode("b", shared, new ArrayList<Termination>(1)) {
      private static final long serialVersionUID = 1L;

      @Override
      public void run(float startTime, float endTime)
          throws SimulationException {}

      @Override
      public void reset(boolean randomize) {}

      public Node[] getChildren() {
        return new Node[0];
      }

      public String toScript(HashMap<String, Object> scriptData) throws ScriptGenException {
        return "";
      }};   
    nodes[2] = new AbstractNode("c", notshared, new ArrayList<Termination>(1)) {
      private static final long serialVersionUID = 1L;

      @Override
      public void run(float startTime, float endTime)
          throws SimulationException {}

      @Override
      public void reset(boolean randomize) {}

      public Node[] getChildren() {
        return new Node[0];
      }

      public String toScript(HashMap<String, Object> scriptData) throws ScriptGenException {
        return "";
      }};
   
    List<String> origins = AbstractEnsemble.findCommon1DOrigins(nodes);
    assertEquals(2, origins.size());
    assertTrue(origins.contains(three.getName()));
    assertTrue(origins.contains(four.getName()));
  }
View Full Code Here

TOP

Related Classes of ca.nengo.model.impl.BasicOrigin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.