Package model.devscore

Examples of model.devscore.BasicDEVSModel


   * @param model
   *          the model
   */
  public void printModelTree(String indent, CoupledModel model) {
    Iterator<IBasicDEVSModel> it = model.getSubModelIterator();
    BasicDEVSModel bmodel;

    while (it.hasNext()) {
      bmodel = (BasicDEVSModel) it.next();
      System.out.println(indent + bmodel.getName());
      if (bmodel instanceof BasicAtomicModel) {
      } else {
        printModelTree(indent + "  ", (CoupledModel) bmodel);
      }
    }
View Full Code Here


                  model.getSubmodelsByClass(currentCoupling.getModel2()));
          // create iterator for retrieved elements
          for (int j = 0; j < targets.size(); j++) {

            // retrieve current targetmodel
            BasicDEVSModel targetModel = (BasicDEVSModel) targets.get(j);
            // retrieve inputport for the given model
            IPort b = targetModel.getInPort(currentCoupling.getPort2());

            copyPortValues(a, b, numberOfElements);

            // the the target model is an atomic model remember that it got
            // an external message

            addToInfluenceeSet(model, influencees, involvedCM, targetModel);
          }
        }
      } // if classcoupling
      else if (coupling instanceof MultiCoupling) {
        // get the next coupling
        MultiCoupling currentCoupling = (MultiCoupling) coupling;
        // this is an out coupling of the current childModel
        // backup a reference to the port
        IPort a = currentCoupling.getPort1();
        // get the number of elements stored at this out port
        int numberOfElements = a.getValuesCount();
        // if there are any elements
        if (numberOfElements > 0) {
          // retrieve vector containing the selected targets of this
          // classcoupling
          List<IBasicDEVSModel> targets =
              currentCoupling.getSelector().executeSelection(
                  currentCoupling.getTargetsAsArrayList());
          // 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

TOP

Related Classes of model.devscore.BasicDEVSModel

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.