Class Sig1JunctionModel
java.lang.Object
|
+--JunctionModel
|
+--Sig1JunctionModel
- All Implemented Interfaces:
- Timed
- Direct Known Subclasses:
- AdaptiveSig1JunModel, Sig2JunctionModel
- public class Sig1JunctionModel
- extends JunctionModel
- implements Timed
Fields inherited from class JunctionModel |
ei, endLanesID, iD, junctionShape, maxNum, parent, paths, pi, si, startLanesID, ticker, totalNumPaths |
Methods inherited from class JunctionModel |
addEndLane, addStartLane, addToTimer, convertToArrayConvienient, createAnyLeft, createAnyOpposite, createAnyRight, createcorrespondingLeft, createcorrespondingRight, createLeftTurns, createPathBetween, createPathBetween, createPathToOppositeSide, createRightTurns, drawAllCars, getAnOpositeLaneFromEdge, getAnOpositeLaneFromJunction, getAnyOutputLane, getCar, getCenter, getID, getLeftDir, getLightsFrom, getLightsTo, getnextLane, getOpDir, getRightDir, getsharedPath, getSpeeds, hasInputOf, isOnLeftSide, isOnMapEdge, isOnRightSide, kill, receiveCar, testForLiveness |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Sig1JunctionModel
public Sig1JunctionModel(int iD,
java.awt.Shape s,
int lighttime,
boolean actuated,
RoadNetwork parent)
generatePaths
public void generatePaths()
- Overrides:
generatePaths
in class JunctionModel
drawJunctionFeatures
public void drawJunctionFeatures(java.awt.Graphics2D g2d)
- Draws the junction traffic lights with the correct colour
- Overrides:
drawJunctionFeatures
in class JunctionModel
pretick
public void pretick()
- Specified by:
pretick
in interface Timed
- Overrides:
pretick
in class JunctionModel
tick
public void tick()
- Specified by:
tick
in interface Timed
- Overrides:
tick
in class JunctionModel
getNextLightSet
public int getNextLightSet(int currentLightSet)
getNextValidLightSet
public int getNextValidLightSet()
resetLights
public void resetLights(int greenSide,
int timerTime)
isOKToGo
public boolean isOKToGo(Car currentcar,
double currentdist)
- Checks whether this signalled junction should allow a car to go or not.
Called by LaneSection when car coming up to junction.
- Specified by:
isOKToGo
in class JunctionModel
- Parameters:
currentcar
- Car that is testing whether it can go.currentdist
- Distance of currentcar to the end of the current lanesection.
isSignalled
public boolean isSignalled()
- Overrides:
isSignalled
in class JunctionModel
giveInfo
public java.lang.String giveInfo()
- Due to mouse Events
- Specified by:
giveInfo
in class JunctionModel