- java.lang.Object
-
- fr.inria.mochy.core.abstractClass.PlaceAbstract
-
- fr.inria.mochy.core.trajectory.TrajPlace
-
public class TrajPlace extends PlaceAbstract
It contains none, one or multiple Trajectory object(s) and symbolize a track portion
-
-
Field Summary
Fields Modifier and Type Field Description String
name
Integer
number
ArrayList<Trajectory>
trajectories
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToken()
add a token in the placevoid
addTrajectory(Trajectory trajectoryToAdd)
add a trajectory to the content by checking if there is no blocking trajectories and update it if there are, so that the place is headway-consistentboolean
availableForNewPlace()
check if it is possible to add a new trajectory if the max ordinates of the segments of the trajectories is less than the distance minus the headwayboolean
createTrajectory(Sampler sampler)
create a simple trajectory (one segment) and add it to the contentString
getName()
get the name of the placeInteger
getNumber()
get the number of the placeTrajTransition
getPost()
void
refactor()
correct the trajectories if there is some crossingsboolean
removeTrajectory()
remove the trajectory which is a single point shapevoid
setPost(TrajTransition transition)
Trajectory
usableTrajectory()
get a usable trajectory if there is one which means that it go to the final point <0,0>
-
-
-
Field Detail
-
name
public String name
-
number
public Integer number
-
trajectories
public ArrayList<Trajectory> trajectories
-
-
Constructor Detail
-
TrajPlace
public TrajPlace(String name, int number, float distance, float headway)
-
-
Method Detail
-
createTrajectory
public boolean createTrajectory(Sampler sampler)
create a simple trajectory (one segment) and add it to the content
-
addTrajectory
public void addTrajectory(Trajectory trajectoryToAdd)
add a trajectory to the content by checking if there is no blocking trajectories and update it if there are, so that the place is headway-consistent
-
removeTrajectory
public boolean removeTrajectory()
remove the trajectory which is a single point shape
-
usableTrajectory
public Trajectory usableTrajectory()
get a usable trajectory if there is one which means that it go to the final point <0,0>
-
availableForNewPlace
public boolean availableForNewPlace()
check if it is possible to add a new trajectory if the max ordinates of the segments of the trajectories is less than the distance minus the headway
-
refactor
public void refactor()
correct the trajectories if there is some crossings
-
getName
public String getName()
Description copied from class:PlaceAbstract
get the name of the place- Specified by:
getName
in classPlaceAbstract
-
getNumber
public Integer getNumber()
Description copied from class:PlaceAbstract
get the number of the place- Specified by:
getNumber
in classPlaceAbstract
-
setPost
public void setPost(TrajTransition transition)
-
getPost
public TrajTransition getPost()
-
addToken
public void addToken()
Description copied from class:PlaceAbstract
add a token in the place- Specified by:
addToken
in classPlaceAbstract
-
-