|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvanted.petrinetelements.PetriNet
public class PetriNet
The Class PetriNet for Petri net handling.
Field Summary | |
---|---|
static java.lang.Integer |
CAPACITY_MAX_VALUE
The capacity maximum value. |
static TransitionRule |
TRANSITION_RULE
The transition rule. |
Constructor Summary | |
---|---|
PetriNet()
Instantiates a new petri net. |
|
PetriNet(org.graffiti.graph.Graph graph)
Instantiates a new petri net. |
Method Summary | |
---|---|
void |
addHideArcWeight(HideArcWeight hideArcWeight)
Adds the object HideArcWeight to the HideArcWeightAttribute. |
void |
addHideCapacity(HideCapacity hideCapacity)
Adds the object HideCapacity to the HideCapacityAttribute. |
void |
addHideLabel(HideLabel hideLabel)
Adds the object HideLabel to the HideLabelAttribute. |
void |
addHideToken(HideToken hideToken)
Adds the object HideToken to the HideTokenAttribute. |
void |
addListener(PetriNetListener listener)
Adds the listener. |
boolean |
createPetriNet(org.graffiti.graph.Graph graph,
boolean transformPetriNet)
Creates the Petri net if it is correct. |
java.util.List<Transition> |
createRandomReversibleTransitions(java.util.List<Transition> transitions)
Returns one random transition of the pair of reversible transitions. |
java.util.List<AbstractArc> |
getAllArcs()
Gets the all arcs. |
java.util.List<Place> |
getAllPlaces()
Gets all the places. |
java.util.List<Place> |
getAllPlacesWithCapacity()
Gets all the places with capacity. |
java.util.List<Transition> |
getAllSelectedTransitions(java.util.Collection<org.graffiti.graph.Node> nodes)
Gets all the selected transitions. |
java.util.List<Transition> |
getAllTransitions()
Gets all the transitions. |
double[] |
getCapacityVector()
|
boolean[] |
getEnabledTransitions(TransitionRule rule)
Gets the enabled transitions. |
boolean[] |
getEnabledTransitionsFromMarking(double[] marking,
TransitionRule rule)
Gets the enabled transitions from marking. |
org.graffiti.graph.Graph |
getGraph()
Gets the graph. |
HideArcWeight |
getHideArcWeight()
Gets the object HideArcWeight which contains true (hiding all arc weight), or false. |
HideCapacity |
getHideCapacity()
Get the object HideCapacity which contains true (hiding all capacities), or false. |
HideLabel |
getHideLabel()
Gets the object HideLabel which contains true (hiding all node label), or false. |
HideToken |
getHideToken()
Gets the object HideToken which contains true (hiding all tokens), or false. |
Library |
getLibrary()
Gets the library. |
java.util.List<PetriNetListener> |
getListeners()
Gets the listeners. |
Marking |
getMarking()
Gets the marking. |
static double[] |
getMarking(PetriNet pn)
Gets the Petri net marking. |
int |
getPlacePosition(Place place)
Gets the place position in the Petri net. |
int |
getTransitionPosition(Transition transition)
Gets the transition position in the Petri net. |
Library |
parsePetriNet2Lib()
Parses the Petri net to the library. |
void |
removeHideArcWeight()
Removes the object HideArcWeight which contains true (hiding all arc weights), or false and the HideArcWeightAttribute. |
void |
removeHideCapacity()
Removes the object HideCapacity which contains true (hiding all capacities), or false and the HideCapacityAttribute. |
void |
removeHideLabel()
Removes the object HideLabel which contains true (hiding all node label), or false and the HideLabelAttribute. |
void |
removeHideToken()
Removes the object HideToken which contains true (hiding all tokens), or false and the HideTokenAttribute. |
boolean |
removeNode(NodePN node)
Removes this node. |
void |
run()
Run infinity. |
void |
run(int steps)
Run with ... steps. |
void |
stop()
Stop both run methods. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.Integer CAPACITY_MAX_VALUE
public static TransitionRule TRANSITION_RULE
Constructor Detail |
---|
public PetriNet()
public PetriNet(org.graffiti.graph.Graph graph)
graph
- the graphMethod Detail |
---|
public org.graffiti.graph.Graph getGraph()
public boolean createPetriNet(org.graffiti.graph.Graph graph, boolean transformPetriNet)
graph
- the graphtransformPetriNet
- the transform petri net
public java.util.List<Place> getAllPlaces()
public java.util.List<Transition> getAllTransitions()
public java.util.List<AbstractArc> getAllArcs()
public boolean removeNode(NodePN node)
node
- the node
public Marking getMarking()
public java.util.List<Place> getAllPlacesWithCapacity()
public java.util.List<Transition> getAllSelectedTransitions(java.util.Collection<org.graffiti.graph.Node> nodes)
nodes
- the nodes
public java.util.List<Transition> createRandomReversibleTransitions(java.util.List<Transition> transitions)
transitions
- the transitionsrevTransitions
- in transitions containing reversible transitions
public void run()
public void run(int steps)
steps
- the stepspublic void stop()
public void addListener(PetriNetListener listener)
listener
- the listenerpublic java.util.List<PetriNetListener> getListeners()
public boolean[] getEnabledTransitions(TransitionRule rule)
rule
- the rule
public boolean[] getEnabledTransitionsFromMarking(double[] marking, TransitionRule rule)
marking
- the markingrule
- the rule
public static double[] getMarking(PetriNet pn)
pn
- the pn
public void addHideToken(HideToken hideToken)
hideToken
- the hide tokenpublic void removeHideToken()
public HideToken getHideToken()
public void addHideCapacity(HideCapacity hideCapacity)
hideCapacity
- the hide capacitypublic void removeHideCapacity()
public HideCapacity getHideCapacity()
public void addHideArcWeight(HideArcWeight hideArcWeight)
hideArcWeight
- the hide arc weightpublic void removeHideArcWeight()
public HideArcWeight getHideArcWeight()
public void addHideLabel(HideLabel hideLabel)
hideLabel
- the hide labelpublic void removeHideLabel()
public HideLabel getHideLabel()
public int getPlacePosition(Place place)
place
- the place
public int getTransitionPosition(Transition transition)
transition
- the transition
public Library parsePetriNet2Lib()
public Library getLibrary()
public double[] getCapacityVector()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |