Package org.woped.qualanalysis.soundness.datamodel

Examples of org.woped.qualanalysis.soundness.datamodel.PlaceNode


        unvisitedPlaces = (HashSet<PlaceNode>) uncoveredPlaces.clone();

        while (!unvisitedPlaces.isEmpty()) {

            // 3. Schritt
            PlaceNode place = unvisitedPlaces.iterator().next();

            // 4.Schritt
            unvisitedPlaces.remove(place);
            component = new HashSet<AbstractNode>();
            component.add(place);
View Full Code Here


        PlaceModel pm;

        // loop over all places
        while (iterPlace.hasNext()) {
            pm = (PlaceModel) iterPlace.next();
            lNet.getPlaceNode(new PlaceNode(pm.getTokenCount(), pm.getVirtualTokenCount(), pm.getId(), pm
                    .getNameValue(), makeOriginId(pm.getId())));
        }

        // loops over all transitions and set predecessors and successors
        while (iterTransition.hasNext()) {
          AbstractPetriNetElementModel trans = iterTransition.next();
          AbstractPetriNetElementModel opTrans = null;
          tm = (TransitionModel) trans;
            successors = NetAlgorithms.getDirectlyConnectedNodes(tm, NetAlgorithms.connectionTypeOUTBOUND);
            predecessors = NetAlgorithms.getDirectlyConnectedNodes(tm, NetAlgorithms.connectionTypeINBOUND);
            ModelElementContainer mec;
            AbstractPetriNetElementModel elem = null;
            Iterator<ModelElementContainer> ownerIterator = trans.getOwningContainersIterator();
            while (ownerIterator.hasNext()) {
              mec = ownerIterator.next();
              elem = mec.getOwningElement();
              if (elem != null && elem.getType() == TransitionModel.TRANS_OPERATOR_TYPE) {
                opTrans = (TransitionModel)elem;
                break;
              }
            }
        
            // add current transition node
            TransitionNode tNode;
            if (opTrans != null && opTrans.getType() == TransitionModel.TRANS_OPERATOR_TYPE) {
              tNode = lNet.getTransitionNode(new TransitionNode(tm.getId(), tm.getNameValue(),
                    makeOriginId(tm.getId()), ((OperatorTransitionModel)opTrans).getOperatorType()));
            }
            else {
              tNode = lNet.getTransitionNode(new TransitionNode(tm.getId(), tm.getNameValue(),
                    makeOriginId(tm.getId()), OperatorTransitionModel.TRANS_SIMPLE_TYPE));
            }

            // add predecessor of current transition node
            for (AbstractPetriNetElementModel predecessor : predecessors) {
                lNet.getPlaceNode(
                        new PlaceNode(((PlaceModel) predecessor).getTokenCount(), ((PlaceModel) predecessor)
                                .getVirtualTokenCount(), predecessor.getId(), predecessor.getNameValue(),
                                makeOriginId(predecessor.getId()))).addPostNode(tNode);
            }

            // add successor of current transition node
            for (AbstractPetriNetElementModel successor : successors) {
                tNode.addPostNode(lNet.getPlaceNode(new PlaceNode(((PlaceModel) successor).getTokenCount(),
                        ((PlaceModel) successor).getVirtualTokenCount(), successor.getId(), successor.getNameValue(),
                        makeOriginId(successor.getId()))));
            }

        }
View Full Code Here

    }

    public LowLevelPetriNet createNewLowLevelPetriNet() {
        LowLevelPetriNet lowlevelNet = new LowLevelPetriNet();

        PlaceNode p1 = lowlevelNet.getPlaceNode(new PlaceNode(2, 2, "p1", null, null));
        PlaceNode p2 = lowlevelNet.getPlaceNode(new PlaceNode(0, 0, "p2", null, null));
        PlaceNode p3 = lowlevelNet.getPlaceNode(new PlaceNode(0, 0, "p3", null, null));
        PlaceNode p4 = lowlevelNet.getPlaceNode(new PlaceNode(0, 0, "p4", null, null));
        PlaceNode p5 = lowlevelNet.getPlaceNode(new PlaceNode(0, 0, "p5", null, null));

        TransitionNode t1 = lowlevelNet.getTransitionNode(new TransitionNode("t1", null, null,0));
        TransitionNode t2 = lowlevelNet.getTransitionNode(new TransitionNode("t2", null, null,0));
        TransitionNode t3 = lowlevelNet.getTransitionNode(new TransitionNode("t3", null, null,0));
View Full Code Here

  private PlaceNode[] places = new PlaceNode[3];
 
  public MNetMock() {
    // Constructor needed to create mock data, transitions and markings     
//    Create places
    places[0] new PlaceNode(0, 0, "p3", "p3", "p3");
    places[1] new PlaceNode(1, 1, "p1", "p1", "p1");
    places[2] new PlaceNode(0, 0, "p2", "p2", "p2");
   
//    Create transitions
    transitions[0] = new TransitionNode("t3", "t3", "t3", OperatorTransitionModel.TRANS_SIMPLE_TYPE);
    transitions[1] = new TransitionNode("t2", "t2", "t2", OperatorTransitionModel.TRANS_SIMPLE_TYPE);
    transitions[2] = new TransitionNode("t1", "t1", "t1", OperatorTransitionModel.TRANS_SIMPLE_TYPE);
View Full Code Here

    // Constructor needed to create mock data, transitions and markings 
    TransitionNode[] transitions = new TransitionNode[3];
    PlaceNode[] places = new PlaceNode[3];
   
//    Create places
    places[0] new PlaceNode(0, 0, "p3", "p3", "p3");
    places[1] new PlaceNode(1, 1, "p1", "p1", "p1");
    places[2] new PlaceNode(0, 0, "p2", "p2", "p2");
   
//    Create transitions
    transitions[0] = new TransitionNode("t3", "t3", "t3", OperatorTransitionModel.TRANS_SIMPLE_TYPE);
    transitions[1] = new TransitionNode("t2", "t2", "t2", OperatorTransitionModel.TRANS_SIMPLE_TYPE);
    transitions[2] = new TransitionNode("t1", "t1", "t1", OperatorTransitionModel.TRANS_SIMPLE_TYPE);
View Full Code Here

  }

  @Test
  public void testGetSourcePlaces() {
    Set<PlaceNode> expected = new HashSet<PlaceNode>();
    expected.add(new PlaceNode(1, 1, "p1", "p1", "p1"));
    Set<PlaceNode> actual = sourceSinkTest.getSourcePlaces();
   
    Assert.assertEquals(expected, actual);
  }
View Full Code Here

  }

  @Test
  public void testGetSinkPlaces() {
    Set<PlaceNode> expected = new HashSet<PlaceNode>();
    expected.add(new PlaceNode(0, 0, "p3", "p3", "p3"));
    Set<PlaceNode> actual = sourceSinkTest.getSinkPlaces();
   
    Assert.assertEquals(expected, actual);
  }
View Full Code Here

TOP

Related Classes of org.woped.qualanalysis.soundness.datamodel.PlaceNode

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.