|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Observable | +--pipe.dataLayer.DataLayer
DataLayer - Encapsulates entire Petri-Net, also contains functions to perform calculations
Field Summary |
Constructor Summary | |
DataLayer()
Create empty Petri-Net object |
|
DataLayer(java.io.File pnmlFile)
Create Petri-Net object from pnmlFile |
|
DataLayer(java.lang.String pnmlFileName)
Create Petri-Net object from PNML file with URI pnmlFileName |
Method Summary | |
void |
addAnnotation(AnnotationNote labelInput)
Add placeInput to the back of the Place ArrayList All observers are notified of this change (Model-View Architecture) |
void |
addArc(Arc arcInput)
Add arcInput to back of the Arc ArrayList All observers are notified of this change (Model-View Architecture) |
void |
addPetriNetObject(PetriNetObject pnObject)
Add any PetriNetObject - the object will be added to the appropriate list. |
void |
addPlace(Place placeInput)
Add placeInput to the back of the Place ArrayList All observers are notified of this change (Model-View Architecture) |
void |
addToken(Token tokenInput)
Add tokenInput to the back of the Token ArrayList All observers are notified of this change. |
void |
addTransition(Transition transitionInput)
Add transitionInput to back of the Transition ArrayList All observers are notified of this change (Model-View Architecture) |
void |
emptyPNML()
Empty all attributes, turn into empty Petri-Net |
Transition |
fireRandomTransition()
Fire a random transition, takes rate (probability) of Transitions into account |
void |
fireRandomTransitionBackwards()
|
void |
fireTransition(Transition transition)
Fire a specified transition, no affect if transtions not enabled |
void |
fireTransitionBackwards(Transition transition)
|
Arc |
getArc(java.lang.String arcName)
Return the Arc called arcName from the Petri-Net |
Arc[] |
getArcs()
Get an List of all the Arcs objects in the Petri-Net |
Arc |
getArcWithSource(PetriNetObject arcName)
Return the Arc called arcName from the Petri-Net |
Arc |
getArcWithTarget(PetriNetObject arcName)
Return the Arc called arcName from the Petri-Net |
int[][] |
getBackwardsIncidenceMatrix()
Return the Backward Incidence Matrix for the Petri-Net |
int[] |
getCurrentMarkupMatrix()
Return the Initial Markup Matrix for the Petri-Net |
org.w3c.dom.Document |
getDOM()
Return a DOM for the Petri-Net |
org.w3c.dom.Document |
getDOM(java.io.File pnmlFile)
Return a DOM for the PNML File pnmlFile |
org.w3c.dom.Document |
getDOM(java.lang.String pnmlFileName)
Return a DOM for the PNML file at URI pnmlFileName |
int[][] |
getForwardsIncidenceMatrix()
Return the Foward Incidence Matrix for the Petri-Net |
int[][] |
getIncidenceMatrix()
Return the Incidence Matrix for the Petri-Net |
int[] |
getInitialMarkupMatrix()
Return the Initial Markup Matrix for the Petri-Net |
AnnotationNote[] |
getLabels()
Get a List of all the net-level NameLabel objects in the Petri-Net |
int |
getListPosition(PetriNetObject pnObject)
Get position of Petri-Net Object in ArrayList of given Petri-Net Object's type |
java.util.Iterator |
getPetriNetObjects()
Returns an iterator of all PetriNetObjects - the order of these cannot be guaranteed. |
Place |
getPlace(int placeNo)
Return the Place called placeName from the Petri-Net |
Place |
getPlace(java.lang.String placeName)
Return the Place called placeName from the Petri-Net |
Place[] |
getPlaces()
Get an List of all the Place objects in the Petri-Net |
PlaceTransitionObject |
getPlaceTransitionObject(java.lang.String ptoId)
Return the PlaceTransitionObject called ptoName from the Petri-Net |
Transition |
getTransition(int transitionNo)
Return the Transition called transitionName from the Petri-Net |
Transition |
getTransition(java.lang.String transitionName)
Return the Transition called transitionName from the Petri-Net |
Transition[] |
getTransitions()
Get an List of all the Transition objects in the Petri-Net |
java.lang.String |
getURI()
Return a URI for the PNML file for the Petri-Net |
void |
loadPNML(java.lang.String filename)
Load PNML file |
void |
print()
prints out a brief representation of the dataLayer object |
void |
removeArc(java.lang.String idInput)
Remove first Arc that has an id equal to idInput |
void |
removePetriNetObject(PetriNetObject pnObject)
Removes the specified object from the appropriate ArrayList of objects. |
void |
removePlace(java.lang.String idInput)
Remove first Place that has an id equal to idInput |
void |
removeTransition(java.lang.String idInput)
Remove first Transition that has an id equal to idInput |
void |
resetEnabledTransitions()
|
void |
restoreInitialMarking()
Restores Initial Markup Matrix to current Petri-Net Markup |
void |
restoreState()
Restores To previous Stored Markup |
java.util.Iterator |
returnTransitions()
|
void |
savePNML(java.io.File file)
Save the Petri-Net |
void |
setArcConnectionMap()
Function populates the arcsMap hashtable enabling easier cross referencing of places, transitions and the arcs connected to them. |
void |
setBackwardsIncidenceMatrix(int[][] backwardsIncidenceInput)
Set the Backward Incidence Matrix |
void |
setEnabledTransitions()
Determines whether all transitions are enabled and sets the correct value of the enabled boolean |
void |
setEnabledTransitionsBackwards()
Determines whether all transitions are enabled and sets the correct value of the enabled boolean |
void |
setFowardIncidenceMatrix(int[][] fowardIncidenceInput)
Set the Foward Incidence Matrix |
void |
setIncidenceMatrix(int[][] incidenceInput)
Set the Incidence Matrix |
void |
setInitalMarkupMatrix(int[][] markupInput)
Set the Initial Markup Matrix |
void |
storeInitialMarking()
Stores Initial Markup Matrix from current Petri-Net Markup |
void |
storeState()
Stores Current Markup |
Methods inherited from class java.util.Observable |
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DataLayer(java.lang.String pnmlFileName)
pnmlFileName
- Name of PNML Filepublic DataLayer(java.io.File pnmlFile)
pnmlFile
- PNML Filepublic DataLayer()
Method Detail |
public void setArcConnectionMap()
public void removePlace(java.lang.String idInput)
idInput
- id of Place object to remove from Petri-Netpublic void removeTransition(java.lang.String idInput)
idInput
- id of Transition object to remove from Petri-Netpublic void removeArc(java.lang.String idInput)
idInput
- id of Arc object to remove from Petri-Netpublic void addPlace(Place placeInput)
placeInput
- Place Object to addpublic void addAnnotation(AnnotationNote labelInput)
public void addTransition(Transition transitionInput)
transitionInput
- Transition Object to addpublic void addArc(Arc arcInput)
arcInput
- Arc Object to addpublic void addToken(Token tokenInput)
tokenInput
- Token Object to addpublic void addPetriNetObject(PetriNetObject pnObject)
pnObject
- The PetriNetObject to be added.public void removePetriNetObject(PetriNetObject pnObject)
pnObject
- The PetriNetObject to be removed.public java.util.Iterator returnTransitions()
public java.util.Iterator getPetriNetObjects()
public void setFowardIncidenceMatrix(int[][] fowardIncidenceInput)
fowardIncidenceInput
- Foward Incidence Matrix objectpublic void setBackwardsIncidenceMatrix(int[][] backwardsIncidenceInput)
backwardsIncidenceInput
- Backward Incidence Matrix objectpublic void setIncidenceMatrix(int[][] incidenceInput)
incidenceInput
- Backward Incidence Matrix objectpublic void setInitalMarkupMatrix(int[][] markupInput)
markupInput
- Initial Markup Matrix objectpublic void savePNML(java.io.File file) throws java.lang.NullPointerException, java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.w3c.dom.DOMException, javax.xml.transform.TransformerConfigurationException, javax.xml.transform.TransformerException
javax.xml.parsers.ParserConfigurationException
org.w3c.dom.DOMException
javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerException
java.lang.NullPointerException
java.io.IOException
public void loadPNML(java.lang.String filename) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.transform.TransformerException, javax.xml.parsers.ParserConfigurationException
filename
- URI location of PNML
java.io.IOException
org.xml.sax.SAXException
javax.xml.transform.TransformerException
javax.xml.parsers.ParserConfigurationException
public void storeInitialMarking()
public void restoreInitialMarking()
public void storeState()
public void restoreState()
public void fireTransition(Transition transition)
transition
- Reference of specifiec Transitionpublic Transition fireRandomTransition()
public void fireTransitionBackwards(Transition transition)
public void fireRandomTransitionBackwards()
public void setEnabledTransitions()
public void resetEnabledTransitions()
public void setEnabledTransitionsBackwards()
public void emptyPNML()
public int getListPosition(PetriNetObject pnObject)
pnObject
- PlaceTransitionObject to get the position of
public Place[] getPlaces()
public AnnotationNote[] getLabels()
public Transition[] getTransitions()
public Arc[] getArcs()
public Transition getTransition(java.lang.String transitionName)
transitionName
- Name of Transition object to return
public Transition getTransition(int transitionNo)
transitionNo
- No of Transition object to return
public Place getPlace(java.lang.String placeName)
placeName
- Name of Place object to return
public Place getPlace(int placeNo)
placeNo
- No of Place object to return
public Arc getArc(java.lang.String arcName)
arcName
- Name of Arc object to return
public Arc getArcWithSource(PetriNetObject arcName)
arcName
- Name of Arc object to return
public Arc getArcWithTarget(PetriNetObject arcName)
arcName
- Name of Arc object to return
public PlaceTransitionObject getPlaceTransitionObject(java.lang.String ptoId)
ptoId
- Id of PlaceTransitionObject object to return
public int[][] getForwardsIncidenceMatrix()
public int[][] getBackwardsIncidenceMatrix()
public int[][] getIncidenceMatrix()
public int[] getInitialMarkupMatrix()
public int[] getCurrentMarkupMatrix()
public org.w3c.dom.Document getDOM(java.lang.String pnmlFileName) throws javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException
pnmlFileName
- URI of PNML file
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
public org.w3c.dom.Document getDOM(java.io.File pnmlFile) throws javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException
pnmlFile
- File Object for PNML of Petri-Net
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
public org.w3c.dom.Document getDOM() throws javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
public java.lang.String getURI()
public void print()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |