Package org.woped.core.model.petrinet

Examples of org.woped.core.model.petrinet.TransitionModel


          alltrans.putAll(getPetrinet().getElementContainer().getElementsByType(AbstractPetriNetElementModel.TRANS_SIMPLE_TYPE));
          alltrans.putAll(getPetrinet().getElementContainer().getElementsByType(AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE));

          for (Iterator<AbstractPetriNetElementModel> transIter = alltrans.values().iterator(); transIter.hasNext() & !isUsed;)
          {
              TransitionModel transition = (TransitionModel)(transIter.next());
              if (transition.getToolSpecific() != null &&
                      transition.getToolSpecific().getTransResource() != null &&
                      transition.getToolSpecific().getTransResource().getTransOrgUnitName() != null &&
                      transition.getToolSpecific().getTransResource().getTransOrgUnitName().equals(GroupName))
              {
                  isUsed = true;
              }
           }
         
View Full Code Here


          alltrans.putAll(getPetrinet().getElementContainer().getElementsByType(AbstractPetriNetElementModel.TRANS_SIMPLE_TYPE));
          alltrans.putAll(getPetrinet().getElementContainer().getElementsByType(AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE));
         
          for (Iterator<AbstractPetriNetElementModel> transIter = alltrans.values().iterator(); transIter.hasNext() & !isUsed;)
          {
              TransitionModel transition = (TransitionModel)(transIter.next());
              if (transition.getToolSpecific() != null &&
                  transition.getToolSpecific().getTransResource() != null &&
                  transition.getToolSpecific().getTransResource().getTransRoleName() != null &&
                  transition.getToolSpecific().getTransResource().getTransRoleName().equals(RoleName))
              {
                  isUsed = true;
              }
           }
         
View Full Code Here

          alltrans.putAll(getPetrinet().getElementContainer().getElementsByType(AbstractPetriNetElementModel.TRANS_SIMPLE_TYPE));
          alltrans.putAll(getPetrinet().getElementContainer().getElementsByType(AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE));

          for (Iterator<AbstractPetriNetElementModel> transIter = alltrans.values().iterator(); transIter.hasNext();)
          {
              TransitionModel transition = (TransitionModel)(transIter.next());
              if (transition.getToolSpecific() != null &&
                      transition.getToolSpecific().getTransResource() != null &&
                      transition.getToolSpecific().getTransResource().getTransRoleName() != null &&
                      transition.getToolSpecific().getTransResource().getTransRoleName().equals(oldName))
              {
                  transition.getToolSpecific().getTransResource().setTransRoleName(newName);
              }
          }   
         
          getPetrinet().replaceResourceClassMapping(oldName, newName);
      }
View Full Code Here

          alltrans.putAll(getPetrinet().getElementContainer().getElementsByType(AbstractPetriNetElementModel.TRANS_SIMPLE_TYPE));
          alltrans.putAll(getPetrinet().getElementContainer().getElementsByType(AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE));

          for (Iterator<AbstractPetriNetElementModel> transIter = alltrans.values().iterator(); transIter.hasNext();)
          {
              TransitionModel transition = (TransitionModel)(transIter.next());
              if (transition.getToolSpecific() != null &&
                      transition.getToolSpecific().getTransResource() != null &&
                      transition.getToolSpecific().getTransResource().getTransOrgUnitName() != null &&
                      transition.getToolSpecific().getTransResource().getTransOrgUnitName().equals(oldName))
              {
                  transition.getToolSpecific().getTransResource().setTransOrgUnitName(newName);
              }
          }  
         
          getPetrinet().replaceResourceClassMapping(oldName, newName);
      }
View Full Code Here

   */
  private boolean importSimulations(SimulationType[] simulations,
      PetriNetModelProcessor currentPetrinet) throws Exception {
    boolean savedFlag = true;
    SimulationModel currSimulation;
    TransitionModel currTransition;
    String currSimulationID;
    int greatestSimulationIDnumber = 0;
    for (int k = 0; k < simulations.length; k++) {
      // collect the information about the current simulation in local
      // variables
      currSimulationID = simulations[k].getId();
      simulations[k].getSimulationdate();
      OccuredtransitionType[] occuredTransitions = simulations[k]
          .getTransitionsequence().getOccuredtransitionArray();
      Vector<TransitionModel> currentTransitions = new Vector<TransitionModel>();
      String currTransitionID = null;
      String currTransitionName = null;
      String arcSource, arcTarget;
      for (int l = 0; l < occuredTransitions.length; l++) {
        currTransition = null;
        currTransitionID = occuredTransitions[l].getTransitionID();
        if (currTransitionID.charAt(0) == 'a') {
          // for XOR-transitions the simulation has to fire arcs
          // instead of simpletransitions
          // because of the inner representation of van der
          // Aalst-operators.
          // Therefore a virtual helper-transition with the arcs' ID
          // and a special name is created.

          arcSource = currentPetrinet.getElementContainer()
              .getArcById(currTransitionID).getSourceId();
          arcTarget = currentPetrinet.getElementContainer()
              .getArcById(currTransitionID).getTargetId();
          if (arcSource.charAt(0) == 't') {
            currTransitionName = arcSource + " -> (" + arcTarget
                + ")";
          } else {
            currTransitionName = "(" + arcSource + ") -> "
                + arcTarget;
          }
          CreationMap map = CreationMap.createMap();
          map.setId(currTransitionID);
          currTransition = new TransitionModel(map);
          currTransition.setNameValue(currTransitionName);
          LoggerManager.debug(Constants.FILE_LOGGER,
              " ... Simulation: HelperTransition for arc ("
                  + currTransitionID + ") created");
        } else {
          currTransition = (TransitionModel) currentPetrinet
View Full Code Here

    this.proc = pmp;
   
    taskAlloc2 = new AllocationTable();
   
    while (tasks.hasNext()){
      TransitionModel transMod = (TransitionModel)tasks.next();
      TransitionResourceModel resMod = transMod.getToolSpecific().getTransResource();
     
      ArrayList<String> rNames = new ArrayList<String>();
      ArrayList<String> gNames = new ArrayList<String>();
      if (resMod != null){
        rNames.add(resMod.getTransRoleName());
        gNames.add(resMod.getTransOrgUnitName());
      }
     
      String tsk = transMod.getNameValue() + " (" + transMod.getId() + ")";
     
      taskAlloc2.getTable().put(tsk, new AllocationTableItem(tsk, rNames, gNames));
     
      Vector<ResourceModel> res = proc.getResources();
     
View Full Code Here

      }
    }
  }

  void addResource(AbstractPetriNetElementModel el, SimNode n) {
    TransitionModel tm = (TransitionModel) el;
    TransitionResourceModel resMod = tm.getToolSpecific().getTransResource();
    if (resMod != null) {
      n.setrole(resMod.getTransRoleName());
      n.setgroup(resMod.getTransOrgUnitName());
      n.setHasResource(true);
    }else{
      TriggerModel t = tm.getToolSpecific().getTrigger();
      if ((t!=null)&&(t.getTriggertype()!=TriggerModel.TRIGGER_RESOURCE))           
        n.settime(0);
    }
  }
View Full Code Here

        return iPlace;
    }

    private TransitionType initTransition(TransitionType iTransition, TransitionModel currentModel, OperatorTransitionModel operatorModel)
    {
        TransitionModel takenModel = operatorModel == null ? currentModel : operatorModel;
        // name
        initNodeName(iTransition.addNewName(), takenModel.getNameModel());
        // graphics
        initElementGraphics(iTransition.addNewGraphics(), takenModel);
        if (ConfigurationManager.getConfiguration().isExportToolspecific())
        {
            // toolspecific
            for (short i = 0; i < takenModel.getUnknownToolSpecs().size(); i++)
            {
                iTransition.addNewToolspecific();
                if (takenModel.getUnknownToolSpecs().get(i) instanceof ToolspecificType)
                {
                    iTransition.setToolspecificArray(iTransition.getToolspecificArray().length - 1, (TransitionToolspecificType) takenModel.getUnknownToolSpecs().get(i));
                }
                // TODO 1 Hochz�hlen
            }
            initToolspecific(iTransition.addNewToolspecific(), takenModel);
        }
View Full Code Here

        return "";
      }
    }
   
    public void drawTime(Graphics2D g2, Dimension d){
      TransitionModel trans = (TransitionModel)this.getCell();
     
      String time = Integer.toString(trans.getToolSpecific().getTime());
      int timeUnit = trans.getToolSpecific().getTimeUnit();
      String tuString = getAbbrev(timeUnit);
     
      if (!time.equals("0") &&
        trans.getToolSpecific().getTrigger() != null &&
      trans.getToolSpecific().getTrigger().getTriggertype() == TriggerModel.TRIGGER_RESOURCE) {
        Font timeFont = DefaultStaticConfiguration.DEFAULT_LABEL_FONT;
        g2.setColor(DefaultStaticConfiguration.DEFAULT_TIME_COLOR);
        g2.setFont(timeFont);
        Rectangle2D bounds = timeFont.getStringBounds(time, g2.getFontRenderContext());
        int xCoord = (int)((d.width - bounds.getWidth())/2);
View Full Code Here

    for (String elementId : mec.getIdMap().keySet()) {
      ele = mec.getElementById(elementId);
      selectElements.add(ele.getParent());
      if (lineType != 2) {
        if (ele instanceof TransitionModel) {
          TransitionModel transitionModel = (TransitionModel) ele;
          if (transitionModel.hasTrigger()) {
            lineType = 1;
          }
          if (transitionModel.hasResource()) {
            lineType = 2;
          }
        }
      }
      vertices.put(ele.getId(), new SGYElement(ele));
View Full Code Here

TOP

Related Classes of org.woped.core.model.petrinet.TransitionModel

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.