- java.lang.Object
-
- fr.inria.mochy.core.abstractClass.PhysicalModel
-
- fr.inria.mochy.core.trajectory.TrajectoryNet
-
public class TrajectoryNet extends PhysicalModel
-
-
Field Summary
Fields Modifier and Type Field Description HashMap<Integer,TrajTransition>
blocked
HashMap<Integer,BooleanPlace>
booleanPlaces
Marking
currentMarking
HashMap<Integer,TrajTransition>
enabled
HashMap<Integer,TrajTransition>
fireable
HashMap<Integer,TrajPlace>
places
HashMap<Integer,TrajTransition>
transitions
-
Fields inherited from class fr.inria.mochy.core.abstractClass.PhysicalModel
discreteStep, fname, nbDiscreteSteps, nbTokens, startLogs, stepsNb, timeElapsed, tokens
-
-
Constructor Summary
Constructors Constructor Description TrajectoryNet(String fname)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addInFlow(int tnum, int pnum)
protected void
addOutFlow(int tnum, int pnum)
Boolean
addToken(int pnum)
Add a token in a placeboolean
busyPostSet(Integer tnum)
void
discreteMove()
perform a discrete move e.g.String
discreteMove(TransitionAbstract onet, String logFile, float currentTime, boolean enableLogs)
perform a discrete move e.g.boolean
discreteMove(String pathLogs, long elapsedTime, boolean enableLogs)
perform a discrete move e.g.void
drop()
display informations of the network modelString
dropConfig()
display informations of the configuration of the network modelPlaceAbstract
findPlace(int pnum)
return the place as specified by its number in parameterTransitionAbstract
findTransition(Integer tnum)
return the transition as specified by its number in parameterTransitionAbstract
findTransition(String string)
return the transition as specified by its name in parameterArrayList<TransitionAbstract>
fireableTransition()
return the list of fireable transitionsPlaceAbstract
getControlPlace(int aplace)
return a control place as specified by its number in parameterHashMap<Integer,? extends PlaceAbstract>
getControlPlaces()
return the list of the control places which can be recovered by their id numberHashMap<Integer,? extends TransitionAbstract>
getEnabled()
get the list of the enabled transitions which can be retrieved by their id numberHashMap<Integer,TrajTransition>
getFirable()
get the list of the fireable transitions which can be retrieved by their id numberHashMap<Integer,TrajPlace>
getPlaces()
list the places which can be recovered with their numberLinkedHashMap<Integer,Token>
getTokens()
HashMap<Integer,TrajTransition>
getTransitions()
list the transitions which can be recovered with their numberint
getWeibullCoef()
get the coefficient used for the weibull prob.protected String
handleLine(String line, int lineNb)
boolean
isBlocked(int tnum)
return true if the transition specified in parameter by its number is blockedboolean
isGaussian()
return true if the prob.boolean
isWeibull()
return true if the prob.String
loadFile()
called to load the input model filefloat
maxAllowedTimedMove()
return the allowed timed move to be elapsed to perform a stepfloat
minimumClock()
return the minimum time to advance in order to update the status of tokens or transitionsvoid
multipleSteps(int steps)
perform the number of steps specified in parameter (timed move, discrete move, ...)int
numberBlocked()
return the number of blocked transitionsint
numberFireable()
return the number of fireable transitionsvoid
progressTime(Float delta)
advance the time of the delta parameter value and update the status of the transitions (blocked, fireable...)void
reset(boolean init)
reset the network model to its initial status-
Methods inherited from class fr.inria.mochy.core.abstractClass.PhysicalModel
getNbDiscreteSteps, getStepsNb, getTimeElapsed, isDiscreteStep
-
-
-
-
Field Detail
-
transitions
public HashMap<Integer,TrajTransition> transitions
-
enabled
public HashMap<Integer,TrajTransition> enabled
-
fireable
public HashMap<Integer,TrajTransition> fireable
-
blocked
public HashMap<Integer,TrajTransition> blocked
-
booleanPlaces
public HashMap<Integer,BooleanPlace> booleanPlaces
-
currentMarking
public Marking currentMarking
-
-
Constructor Detail
-
TrajectoryNet
public TrajectoryNet(String fname)
-
-
Method Detail
-
loadFile
public String loadFile()
Description copied from class:PhysicalModel
called to load the input model file- Specified by:
loadFile
in classPhysicalModel
-
addInFlow
protected void addInFlow(int tnum, int pnum)
-
addOutFlow
protected void addOutFlow(int tnum, int pnum)
-
addToken
public Boolean addToken(int pnum)
Add a token in a place- Specified by:
addToken
in classPhysicalModel
- Parameters:
pnum
-- Returns:
-
maxAllowedTimedMove
public float maxAllowedTimedMove()
Description copied from class:PhysicalModel
return the allowed timed move to be elapsed to perform a step- Specified by:
maxAllowedTimedMove
in classPhysicalModel
-
numberFireable
public int numberFireable()
Description copied from class:PhysicalModel
return the number of fireable transitions- Specified by:
numberFireable
in classPhysicalModel
-
numberBlocked
public int numberBlocked()
Description copied from class:PhysicalModel
return the number of blocked transitions- Specified by:
numberBlocked
in classPhysicalModel
-
isBlocked
public boolean isBlocked(int tnum)
Description copied from class:PhysicalModel
return true if the transition specified in parameter by its number is blocked- Specified by:
isBlocked
in classPhysicalModel
-
progressTime
public void progressTime(Float delta)
Description copied from class:PhysicalModel
advance the time of the delta parameter value and update the status of the transitions (blocked, fireable...)- Specified by:
progressTime
in classPhysicalModel
-
discreteMove
public void discreteMove()
Description copied from class:PhysicalModel
perform a discrete move e.g. a transition will be fired and a token will change of place- Specified by:
discreteMove
in classPhysicalModel
-
multipleSteps
public void multipleSteps(int steps)
Description copied from class:PhysicalModel
perform the number of steps specified in parameter (timed move, discrete move, ...)- Specified by:
multipleSteps
in classPhysicalModel
-
reset
public void reset(boolean init)
Description copied from class:PhysicalModel
reset the network model to its initial status- Overrides:
reset
in classPhysicalModel
-
discreteMove
public boolean discreteMove(String pathLogs, long elapsedTime, boolean enableLogs)
Description copied from class:PhysicalModel
perform a discrete move e.g. a transition will be fired and a token will change of place- Specified by:
discreteMove
in classPhysicalModel
-
drop
public void drop()
Description copied from class:PhysicalModel
display informations of the network model- Specified by:
drop
in classPhysicalModel
-
busyPostSet
public boolean busyPostSet(Integer tnum)
-
findTransition
public TransitionAbstract findTransition(Integer tnum)
Description copied from class:PhysicalModel
return the transition as specified by its number in parameter- Specified by:
findTransition
in classPhysicalModel
-
dropConfig
public String dropConfig()
Description copied from class:PhysicalModel
display informations of the configuration of the network model- Specified by:
dropConfig
in classPhysicalModel
-
findPlace
public PlaceAbstract findPlace(int pnum)
Description copied from class:PhysicalModel
return the place as specified by its number in parameter- Specified by:
findPlace
in classPhysicalModel
-
getControlPlace
public PlaceAbstract getControlPlace(int aplace)
Description copied from class:PhysicalModel
return a control place as specified by its number in parameter- Specified by:
getControlPlace
in classPhysicalModel
-
minimumClock
public float minimumClock()
Description copied from class:PhysicalModel
return the minimum time to advance in order to update the status of tokens or transitions- Specified by:
minimumClock
in classPhysicalModel
-
fireableTransition
public ArrayList<TransitionAbstract> fireableTransition()
Description copied from class:PhysicalModel
return the list of fireable transitions- Specified by:
fireableTransition
in classPhysicalModel
-
discreteMove
public String discreteMove(TransitionAbstract onet, String logFile, float currentTime, boolean enableLogs)
Description copied from class:PhysicalModel
perform a discrete move e.g. a transition will be fired and a token will change of place- Specified by:
discreteMove
in classPhysicalModel
-
getEnabled
public HashMap<Integer,? extends TransitionAbstract> getEnabled()
Description copied from class:PhysicalModel
get the list of the enabled transitions which can be retrieved by their id number- Specified by:
getEnabled
in classPhysicalModel
-
getFirable
public HashMap<Integer,TrajTransition> getFirable()
Description copied from class:PhysicalModel
get the list of the fireable transitions which can be retrieved by their id number- Specified by:
getFirable
in classPhysicalModel
-
getTransitions
public HashMap<Integer,TrajTransition> getTransitions()
Description copied from class:PhysicalModel
list the transitions which can be recovered with their number- Specified by:
getTransitions
in classPhysicalModel
-
isGaussian
public boolean isGaussian()
Description copied from class:PhysicalModel
return true if the prob. distribution is gaussian. used for the sampling of the transitions- Specified by:
isGaussian
in classPhysicalModel
-
isWeibull
public boolean isWeibull()
Description copied from class:PhysicalModel
return true if the prob. distribution is weibull. used for the sampling of the transitions- Specified by:
isWeibull
in classPhysicalModel
-
getWeibullCoef
public int getWeibullCoef()
Description copied from class:PhysicalModel
get the coefficient used for the weibull prob. distribution. used for the sampling of the transitions- Specified by:
getWeibullCoef
in classPhysicalModel
-
findTransition
public TransitionAbstract findTransition(String string)
Description copied from class:PhysicalModel
return the transition as specified by its name in parameter- Specified by:
findTransition
in classPhysicalModel
-
getPlaces
public HashMap<Integer,TrajPlace> getPlaces()
Description copied from class:PhysicalModel
list the places which can be recovered with their number- Specified by:
getPlaces
in classPhysicalModel
-
getControlPlaces
public HashMap<Integer,? extends PlaceAbstract> getControlPlaces()
Description copied from class:PhysicalModel
return the list of the control places which can be recovered by their id number- Specified by:
getControlPlaces
in classPhysicalModel
-
getTokens
public LinkedHashMap<Integer,Token> getTokens()
- Specified by:
getTokens
in classPhysicalModel
-
-