Examples of IBasicDEVSModel


Examples of model.devscore.IBasicDEVSModel

  @Override
  public void modifyModel(M model) {

    try {

      IBasicDEVSModel fromModel = getModel1();
      IPort fromPort = getPort1();
      IBasicDEVSModel toModel = getModel2();
      IPort toPort = getPort2();

      // Lookup models if needed

      Pair<IBasicDEVSModel, IPort> src =
View Full Code Here

Examples of model.devscore.IBasicDEVSModel

      Map<IBasicDEVSModel, Map<IPort, List<BasicCoupling>>> couplingsList) {

    // do this for all sub models
    Iterator<IBasicDEVSModel> it = model.getSubModelIterator();
    while (it.hasNext()) {
      IBasicDEVSModel m = it.next();
      // if sub model is a coupled model recursively call this method
      if (m instanceof IBasicCoupledModel) {
        getAllCouplings((IBasicCoupledModel) m, couplingsList);
      }
    }
View Full Code Here

Examples of model.devscore.IBasicDEVSModel

   * @return the couplings
   */
  private List<BasicCoupling> getCouplings(Coupling coupling,
      Map<IBasicDEVSModel, Map<IPort, List<BasicCoupling>>> allCouplings) {

    IBasicDEVSModel startModel = coupling.getModel1();
    IPort startPort = coupling.getPort1();

    // this is okay because we only allow couplings of type Coupling here
    IBasicDEVSModel endModel = coupling.getModel2();
    IPort endPort = coupling.getPort2();

    // find the targets of the given coupling, these are the models finally
    // receiving events transferred by this coupling
    List<BasicCoupling> result =
View Full Code Here

Examples of model.devscore.IBasicDEVSModel

    // we'll now take each coupling starting at an atomic model and compute its
    // target

    for (Map.Entry<IBasicDEVSModel, Map<IPort, List<BasicCoupling>>> iBasicDEVSModelMapEntry : allCouplings.entrySet
            ()) {
      IBasicDEVSModel m = iBasicDEVSModelMapEntry.getKey();

      // if the model m is an atomic one we have found a potential source of
      // external events
      if (!(m instanceof IBasicCoupledModel)) {
        // get all couplings (per port) of this event source
View Full Code Here

Examples of model.devscore.IBasicDEVSModel

   *          the struc changes per model
   */
  protected void organizeStrucChanges(IDynamicAtomicModel am,
      Map<IBasicDEVSModel, List<ChangeRequest<?>>> strucChangesPerModel) {

    IBasicDEVSModel entry;

    ChangeRequest<?>[] amchgs = new ChangeRequest[1];

    amchgs = am.getChangeRequests().toArray(amchgs);

View Full Code Here

Examples of model.devscore.IBasicDEVSModel

   * @return HashMap(String, ArrayList) -> list of out ports with existing
   *         values
   */
  public Map<String, List<Object>> getHashedSendValues() {
    // System.out.println("trying to get send values");
    IBasicDEVSModel model = getModel();

    Map<String, List<Object>> result = new HashMap<>();

    Iterator<IPort> itp = model.getOutPortIterator();
    IPort p;

    // while there are ports
    while (itp.hasNext()) {

View Full Code Here

Examples of model.devscore.IBasicDEVSModel

   * @return ArrayList -> list of out ports with existing values as a list of
   *         PortParcels
   */
  public List<PortParcel> getSendValues() {

    IBasicDEVSModel model = getModel();

    ArrayList<PortParcel> result = new ArrayList<>();

    Iterator<IPort> itp = model.getOutPortIterator();
    IPort p;

    // while there are ports
    while (itp.hasNext()) {

View Full Code Here

Examples of model.devscore.IBasicDEVSModel

   *          the port1
   *
   * @return the context
   */
  private static IBasicDEVSModel getContext(IBasicDEVSModel model1, IPort port1) {
    IBasicDEVSModel con = null;

    if (model1 instanceof IDynamicAtomicModel) {
      con = model1.getParent();
    } else {
      if (model1.hasInPort(port1)) {
View Full Code Here

Examples of model.devscore.IBasicDEVSModel

          // create iterator for retrieved elements
          // Iterator targetIterator = targets.iterator();
          // System.out.println(currentCoupling.getTargetsAsArrayList().size());
          for (int j = 0; j < targets.size(); j++) {
            // retrieve current targetmodel
            IBasicDEVSModel targetModel = targets.get(j);
            // retrieve inputport for the given model
            String portname =
                (currentCoupling.getTargets().getTarget(targetModel))
                    .getPortName();
            IPort b = targetModel.getInPort(portname);

            copyPortValues(a, b, numberOfElements);

            // the the target model is an atomic model remember that it got
            // an external message
View Full Code Here

Examples of model.devscore.IBasicDEVSModel

   * last one to be processed out of the current set of imminents
   *
   * @return
   */
  private IBasicDEVSModel getNextModelToBeProcessed() {
    IBasicDEVSModel model = getNext();
    i++;
    if (i == numberOfImminents) {
      done();
    }
    return model;
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.