- java.lang.Object
-
- fr.inria.mochy.core.abstractClass.PhysicalModel
-
- Direct Known Subclasses:
EquNet
,Net
,TrajectoryNet
public abstract class PhysicalModel extends Object
it is the abstraction of mochysim.Net, trajectory.TrajectoryNet, equalization.EquNet... and models the transport networks via petri-nets
-
-
Field Summary
Fields Modifier and Type Field Description boolean
discreteStep
set to true when the last step is a discrete step (in contrary to to a timed move)String
fname
the name of the input model file loadedint
nbDiscreteSteps
number of discrete steps that occurred during simulationint
nbTokens
the number of tokens in the networkboolean
startLogs
set to true once the first line of the logs of the out.txt file have be writtenint
stepsNb
the number of steps performed (timed move, discrete move...)float
timeElapsed
duration elapsed so far during a simulationLinkedHashMap<Integer,Token>
tokens
the list of the tokens which represents train, metro...
-
Constructor Summary
Constructors Constructor Description PhysicalModel()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Boolean
addToken(int p)
add a token in the place specified in parameter by its numberabstract void
discreteMove()
perform a discrete move e.g.abstract String
discreteMove(TransitionAbstract onet, String logFile, float currentTime, boolean enableLogs)
perform a discrete move e.g.abstract boolean
discreteMove(String pathLogs, long elapsedTime, boolean enableLogs)
perform a discrete move e.g.abstract void
drop()
display informations of the network modelabstract String
dropConfig()
display informations of the configuration of the network modelabstract PlaceAbstract
findPlace(int pname)
return the place as specified by its number in parameterabstract TransitionAbstract
findTransition(Integer tname)
return the transition as specified by its number in parameterabstract TransitionAbstract
findTransition(String string)
return the transition as specified by its name in parameterabstract ArrayList<TransitionAbstract>
fireableTransition()
return the list of fireable transitionsabstract PlaceAbstract
getControlPlace(int aplace)
return a control place as specified by its number in parameterabstract HashMap<Integer,? extends PlaceAbstract>
getControlPlaces()
return the list of the control places which can be recovered by their id numberabstract HashMap<Integer,? extends TransitionAbstract>
getEnabled()
get the list of the enabled transitions which can be retrieved by their id numberabstract HashMap<Integer,? extends TransitionAbstract>
getFirable()
get the list of the fireable transitions which can be retrieved by their id numberint
getNbDiscreteSteps()
get the number of discrete steps performedabstract HashMap<Integer,? extends PlaceAbstract>
getPlaces()
list the places which can be recovered with their numberint
getStepsNb()
get the steps (timed moves, discrete moves...) performedfloat
getTimeElapsed()
get the time elapsedabstract LinkedHashMap<Integer,Token>
getTokens()
abstract HashMap<Integer,? extends TransitionAbstract>
getTransitions()
list the transitions which can be recovered with their numberabstract int
getWeibullCoef()
get the coefficient used for the weibull prob.abstract boolean
isBlocked(int tnum)
return true if the transition specified in parameter by its number is blockedboolean
isDiscreteStep()
return true if the last step is a discrete stepabstract boolean
isGaussian()
return true if the prob.abstract boolean
isWeibull()
return true if the prob.abstract String
loadFile()
called to load the input model fileabstract float
maxAllowedTimedMove()
return the allowed timed move to be elapsed to perform a stepabstract float
minimumClock()
return the minimum time to advance in order to update the status of tokens or transitionsabstract void
multipleSteps(int steps)
perform the number of steps specified in parameter (timed move, discrete move, ...)abstract int
numberBlocked()
return the number of blocked transitionsabstract int
numberFireable()
return the number of fireable transitionsabstract void
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
-
-
-
Field Detail
-
fname
public String fname
the name of the input model file loaded
-
timeElapsed
public float timeElapsed
duration elapsed so far during a simulation
-
stepsNb
public int stepsNb
the number of steps performed (timed move, discrete move...)
-
nbDiscreteSteps
public int nbDiscreteSteps
number of discrete steps that occurred during simulation
-
discreteStep
public boolean discreteStep
set to true when the last step is a discrete step (in contrary to to a timed move)
-
startLogs
public boolean startLogs
set to true once the first line of the logs of the out.txt file have be written
-
nbTokens
public int nbTokens
the number of tokens in the network
-
tokens
public LinkedHashMap<Integer,Token> tokens
the list of the tokens which represents train, metro... in the network
-
-
Method Detail
-
loadFile
public abstract String loadFile()
called to load the input model file
-
getTransitions
public abstract HashMap<Integer,? extends TransitionAbstract> getTransitions()
list the transitions which can be recovered with their number
-
getPlaces
public abstract HashMap<Integer,? extends PlaceAbstract> getPlaces()
list the places which can be recovered with their number
-
maxAllowedTimedMove
public abstract float maxAllowedTimedMove()
return the allowed timed move to be elapsed to perform a step
-
numberFireable
public abstract int numberFireable()
return the number of fireable transitions
-
numberBlocked
public abstract int numberBlocked()
return the number of blocked transitions
-
isBlocked
public abstract boolean isBlocked(int tnum)
return true if the transition specified in parameter by its number is blocked
-
progressTime
public abstract void progressTime(Float delta)
advance the time of the delta parameter value and update the status of the transitions (blocked, fireable...)
-
discreteMove
public abstract void discreteMove()
perform a discrete move e.g. a transition will be fired and a token will change of place
-
multipleSteps
public abstract void multipleSteps(int steps)
perform the number of steps specified in parameter (timed move, discrete move, ...)
-
reset
public void reset(boolean init)
reset the network model to its initial status
-
discreteMove
public abstract boolean discreteMove(String pathLogs, long elapsedTime, boolean enableLogs)
perform a discrete move e.g. a transition will be fired and a token will change of place
-
drop
public abstract void drop()
display informations of the network model
-
dropConfig
public abstract String dropConfig()
display informations of the configuration of the network model
-
findTransition
public abstract TransitionAbstract findTransition(Integer tname)
return the transition as specified by its number in parameter
-
findTransition
public abstract TransitionAbstract findTransition(String string)
return the transition as specified by its name in parameter
-
findPlace
public abstract PlaceAbstract findPlace(int pname)
return the place as specified by its number in parameter
-
addToken
public abstract Boolean addToken(int p)
add a token in the place specified in parameter by its number
-
getControlPlace
public abstract PlaceAbstract getControlPlace(int aplace)
return a control place as specified by its number in parameter
-
getControlPlaces
public abstract HashMap<Integer,? extends PlaceAbstract> getControlPlaces()
return the list of the control places which can be recovered by their id number
-
minimumClock
public abstract float minimumClock()
return the minimum time to advance in order to update the status of tokens or transitions
-
fireableTransition
public abstract ArrayList<TransitionAbstract> fireableTransition()
return the list of fireable transitions
-
discreteMove
public abstract String discreteMove(TransitionAbstract onet, String logFile, float currentTime, boolean enableLogs)
perform a discrete move e.g. a transition will be fired and a token will change of place
-
getEnabled
public abstract HashMap<Integer,? extends TransitionAbstract> getEnabled()
get the list of the enabled transitions which can be retrieved by their id number
-
getFirable
public abstract HashMap<Integer,? extends TransitionAbstract> getFirable()
get the list of the fireable transitions which can be retrieved by their id number
-
isGaussian
public abstract boolean isGaussian()
return true if the prob. distribution is gaussian. used for the sampling of the transitions
-
isWeibull
public abstract boolean isWeibull()
return true if the prob. distribution is weibull. used for the sampling of the transitions
-
getWeibullCoef
public abstract int getWeibullCoef()
get the coefficient used for the weibull prob. distribution. used for the sampling of the transitions
-
getTimeElapsed
public float getTimeElapsed()
get the time elapsed
-
getStepsNb
public int getStepsNb()
get the steps (timed moves, discrete moves...) performed
-
getNbDiscreteSteps
public int getNbDiscreteSteps()
get the number of discrete steps performed
-
isDiscreteStep
public boolean isDiscreteStep()
return true if the last step is a discrete step
-
getTokens
public abstract LinkedHashMap<Integer,Token> getTokens()
-
-