Package ca.nengo.model

Examples of ca.nengo.model.Node


          if (!(target instanceof Node)) {
            UserMessages.showError("Unsupported target type for probe");
          } else {
 
            if (probe.isInEnsemble() && probe.getEnsembleName() == getModel().getName()) {
              Node node = (Node) target;
 
              UINeoNode nodeUI = getUINode(node);
              if(nodeUI  != null){
                nodeUI.showProbe(probe);
              }
View Full Code Here


                UserMessages.showError("Unsupported target type for probe");
            } else {

                if (!probe.isInEnsemble()) {

                    Node node = (Node) target;

                    UINeoNode nodeUI = getUINode(node);
                    if (nodeUI != null) {
                        nodeUI.showProbe(probe);
                    } else {
View Full Code Here

      throws SimulationException {

    /*
     * Creates the probe
     */
    Node node = nodeAttachedTo.getModel();
    Probe probe;
    try {
      if (nodeAttachedTo.getParentViewer() instanceof EnsembleViewer) {
        EnsembleViewer ensembleViewer = (EnsembleViewer) nodeAttachedTo.getParentViewer();

        UIEnsemble ensemble = ensembleViewer.getViewerParent();
        Network network = ensemble.getNetworkParent().getModel();

        probe = network.getSimulator().addProbe(ensemble.getName(),
            (Probeable) node,
            state,
            true);

      } else if (nodeAttachedTo.getNetworkParent() != null) {
        probe = nodeAttachedTo.getNetworkParent().getSimulator().addProbe(node.getName(),
            state,
            true);
      } else {
        throw new SimulationException(
            "Cannot add a probe to a node that is not inside a Network");
View Full Code Here

        NodeContainer nodeContainer = (NodeContainer) wo;

        try {
          CreateModelAction.ensureNonConflictingName(getModel(), nodeContainer); // throws UserCancelledException
         
          Node node;
          try {
            node = getModel().clone();
          } catch (CloneNotSupportedException e) {
            throw new ContainerException("Could not clone node: " + e.getMessage());
          }
View Full Code Here

        ArrayList<Node> nodes = new ArrayList<Node>();

        List<Node> nodesToProcess = new LinkedList<Node>();
        nodesToProcess.addAll(Arrays.asList(startingNodes));

        Node workingNode;

        boolean isNetwork = false;
        while(nodesToProcess.size() != 0)
        {
            workingNode = nodesToProcess.remove(0);
           
            //Decide whether to break the node into its subnodes
            if((workingNode.getClass().getCanonicalName().contains("CCMModelNetwork"))){
              isNetwork = false;
            }
            else if(workingNode instanceof NetworkArrayImpl)
            {
              if(breakDownNetworkArrays){
View Full Code Here

        ArrayList<Projection> projections = new ArrayList<Projection>(Arrays.asList(startingProjections));

        List<Node> nodesToProcess = new LinkedList<Node>();
        nodesToProcess.addAll(Arrays.asList(startingNodes));

        Node workingNode;

        while(nodesToProcess.size() != 0)
        {
            workingNode = nodesToProcess.remove(0);
View Full Code Here

        ArrayList<ThreadTask> tasks = new ArrayList<ThreadTask>();

        List<Node> nodesToProcess = new LinkedList<Node>();
        nodesToProcess.addAll(Arrays.asList(startingNodes));

        Node workingNode;

        while(nodesToProcess.size() != 0)
        {
            workingNode = nodesToProcess.remove(0);

            if(workingNode instanceof Network && !(workingNode.getClass().getCanonicalName().contains("CCMModelNetwork")))
            {
                List<Node> nodeList = new LinkedList<Node>(Arrays.asList(((Network) workingNode).getNodes()));

                nodeList.addAll(nodesToProcess);
                nodesToProcess = nodeList;
View Full Code Here

    int[][] adjustedProjections = new int[myGPUProjections.length][6];
   
   
    inputOnGPU = new boolean[myGPUNetworkArrays.length][];
   
    Node workingArray;
    int networkArrayOffset = 0;

    NetworkArrayData networkArrayData = new NetworkArrayData();
    int[][] networkArrayDataArray = new int[myGPUNetworkArrays.length][];

    int totalInputSize = 0;
   
    // store networkArray data
    for(i = 0; i < myGPUNetworkArrays.length; i++){
     
      networkArrayData.reset();
      workingArray = myGPUNetworkArrays[i];
     
      networkArrayData.indexOfFirstNode = networkArrayOffset;
     
      if(workingArray instanceof NEFEnsembleImpl){
        networkArrayOffset++;
      }else{
        networkArrayOffset += ((NetworkImpl) workingArray).getNodes().length;
      }
     
      networkArrayData.endIndex = networkArrayOffset;
       
      Termination[] networkArrayTerminations = workingArray.getTerminations();
      networkArrayData.numTerminations = networkArrayTerminations.length;
     
     
      for(j = 0; j < networkArrayTerminations.length; j++){
        networkArrayData.totalInputSize += networkArrayTerminations[j].getDimensions();
      }
     
      totalInputSize += networkArrayData.totalInputSize;
     
      Origin[] networkArrayOrigins;
      if(workingArray instanceof NEFEnsembleImpl)
      {
        networkArrayOrigins = ((NEFEnsembleImpl) workingArray).getDecodedOrigins();
      }else{
        networkArrayOrigins = workingArray.getOrigins();
      }
      networkArrayData.numOrigins = networkArrayOrigins.length;
     
      for(j = 0; j < networkArrayOrigins.length; j++){
        networkArrayData.totalOutputSize += networkArrayOrigins[j].getDimensions();
View Full Code Here

  public Node[] takeGPUNodes(Node[] nodes){
    ArrayList<Node> gpuNodeList = new ArrayList<Node>();
    ArrayList<Node> nodeList = new ArrayList<Node>();
   
    for(int i = 0; i < nodes.length; i++){
      Node workingNode = nodes[i];
      boolean NEFEnsembleUseGPU =
        workingNode instanceof NEFEnsembleImpl && ((NEFEnsembleImpl) workingNode).getUseGPU();
     
      boolean NetworkArrayUseGPU =
        workingNode instanceof NetworkArrayImpl &&
View Full Code Here

   
    List<Node> GPUNetworkArrayList = Arrays.asList(myGPUNetworkArrays);
   
    for(int i = 0; i < projections.length; i++)
    {
      Node originNode = projections[i].getOrigin().getNode();
      Node terminationNode = projections[i].getTermination().getNode();

      boolean originNodeOnGPU = GPUNetworkArrayList.contains(originNode);
      boolean terminationNodeOnGPU = GPUNetworkArrayList.contains(terminationNode);
     
      if(originNodeOnGPU && terminationNodeOnGPU)
View Full Code Here

TOP

Related Classes of ca.nengo.model.Node

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.