Examples of SimulationException


Examples of ca.nengo.model.SimulationException

                String originName = stateName.substring(0,stateName.length()-4);
                try {
                    DecodedOrigin o = (DecodedOrigin) getOrigin(originName);
                    result = o.getSTPHistory();
                } catch (StructuralException e) {
                    throw new SimulationException(e);
                }
    } else {
        result = super.getHistory(stateName);
    }
View Full Code Here

Examples of ca.nengo.model.SimulationException

   * @param noises New output noise model for each dimension of output
   * @throws SimulationException
   */
  public void setNoises(Noise[] noises) throws SimulationException {
    if(noises.length != getDimensions()) {
      throw new SimulationException("Provided noises do not match dimension of origin");
    }
    myNoise = noises[0];
    myNoises = new Noise[getDimensions()];
    for (int i = 0; i < myNoises.length; i++) {
      myNoises[i] = noises[i];
View Full Code Here

Examples of ca.nengo.model.SimulationException

   * @throws SimulationException If the given state is not of the expected dimension (ie the input
   *     dimension of the functions provided in the constructor)
   */
  public void run(float[] state, float startTime, float endTime) throws SimulationException {
    if (state != null && state.length != myFunctions[0].getDimension()) {
      throw new SimulationException("Origin dimension is " + myFunctions[0].getDimension() +
          " but state dimension is " + state.length);
    }

    float[] values = new float[myFunctions.length];
    float stepSize = endTime - startTime;

    mySTPHistory = new float[myNodes.length];
    if (myMode == SimulationMode.DIRECT) {
      for (int i = 0; i < values.length; i++) {
        values[i] = myFunctions[i].map(state);
      }
    } else if (myMode == SimulationMode.EXPRESS) {
      for (int i = 0; i < values.length; i++) {
        values[i] = myFunctions[i].map(state);
      }
     
      //create default ExpressModel if necessary ...
      if (myExpressModel == null) {
        myExpressModel = new DefaultExpressModel(this);
      }
     
      values = myExpressModel.getOutput(startTime, state, values);
    } else {
      for (int i = 0; i < myNodes.length; i++) {
        try {
          InstantaneousOutput o = myNodes[i].getOrigin(myNodeOrigin).getValues();

          float val = 0;
          if (o instanceof SpikeOutput) {
            val = ((SpikeOutput) o).getValues()[0] ? 1f / stepSize : 0f;
          } else if (o instanceof RealOutput) {
            val = ((RealOutput) o).getValues()[0];
          } else {
            throw new Error("Node output is of type " + o.getClass().getName()
              + ". DecodedOrigin can only deal with RealOutput and SpikeOutput, so it apparently has to be updated");
          }

          float[] decoder = getDynamicDecoder(i, val, startTime, endTime);
          for (int j = 0; j < values.length; j++) {
            values[j] += val * decoder[j];
          }
        } catch (StructuralException e) {
          throw new SimulationException(e);
        }
      }
    }
   
    if (myNoise != null) {
View Full Code Here

Examples of core.simulation.SimulationException

          }
          in.close();
      }
    catch (IOException e)
    {
        throw new SimulationException( e.getMessage() );
      }
  }
View Full Code Here

Examples of core.simulation.SimulationException

          }
          in.close();
      }
    catch (IOException e)
    {
        throw new SimulationException( e.getMessage() );
      }
  }
View Full Code Here

Examples of cu.repsystestbed.exceptions.SimulationException

    super(sender, receiver);
    if(assessee==null)
    {
      String msg = "Assessee is null.";
      logger.error(msg);
      throw new SimulationException(msg);
    }
    this.setAssessee(assessee);
  }
View Full Code Here

Examples of cu.repsystestbed.exceptions.SimulationException

  {
    if(sender==null || receiver==null)
    {
      String msg = "Sender or receiver is null.";
      logger.error(msg);
      throw new SimulationException(msg);
    }
    if(sender.equals(receiver))
    {
      String msg = "Cannot send a message to self.";
      logger.error(msg);
      throw new SimulationException(msg);
    }
   
    messageId = this.messageIdCounter++;
    this.sender = sender;
    this.receiver = receiver;
View Full Code Here

Examples of cu.repsystestbed.exceptions.SimulationException

     
    }else
    {
      String error = "Unknown message received.";
      logger.error(error);
      throw new SimulationException(error);
    }
    
  }
View Full Code Here

Examples of cu.repsystestbed.exceptions.SimulationException

  {
    if(simulationEngine==null)
    {
      String error = "Simulation engine is null.";
      logger.error(error);
      throw new SimulationException(error);
    }
    this.simulationEngine = simulationEngine;
    this.simulationEngine.registerAgent(this);
  }
View Full Code Here

Examples of cu.repsystestbed.exceptions.SimulationException

  {
    if(agent==null)
    {
      String error = "Cannot register a null agent.";
      logger.error(error);
      throw new SimulationException(error);
    }
    if(this.registeredAgents.containsKey(agent.id))
    {
      String error = "Agent " + agent.id + " already added.";
      logger.error(error);
      throw new SimulationException(error);
    }
    this.registeredAgents.put(agent.id, agent);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.