CHAPTER 4. CODING PROCESS
12
Road |
Drivelane | |
tfroadld:int #1 ength: int #alphaNode:Node #betaNode:Node #alphaLanes:Drivelane[] #betaLanes:Drivelane[] #tums:Tum[] |
tfid:int #type:int #road:Road tfqueue: LinkedList #sign:Sign #cycleAsked:int #cyeleMoved:int #statistics:DrivelaneStatistics #c UrCycIeJnt | |
+Ro ad (alpha: int, beta: Node, length: int): +addAlpha Lane (lane: D rive lane): void +rem Tum(VTum): void +addLane(lane:Drivelane,to:Node):void +getOtherNode(seenfnom: Node): Node +getNum AIILanesO: Integ er +getNum AIphaLanesO: Integer +getNum BetaLanesOJnteger +getNumOutboundLanes(n: No de): Integer +paint (g:Gra phics,x: int,у J nt,zf: Floatyvoid +is Enabled O: Boolean +setEnabled(b:Boolean):void | ||
+Dr iv elane (road: Ro ad): +getTail Length ɑ:lnteger +getCom PleteLengthOHnteger +resetθ:void +addRoaduserAtEnd(ru: RoadwserXvoi d +addRoad userAt End(ru: Roadwser,pos: int):voi d +ad d Ro ad us er(ru: Roadwse/, pos:int):voi d +re m Ro a d us e rAt St art O: Roadttser +mayUser(ruType:int):Boolean +get Length O: int +get FirstRo ad use rQ.Roadιtser +getNum RoadusersWaiti ng OJnt +getNum B IockSWaitingO: int +getNodeCom esFromQ:Node +getNodeLeadsToO Node +getTarget(target:int):Boolean +setTarget (target: int,st ate: bool ean):voi d +isPosFree(p osit ion JntJength: і nt): bo olean +isT ailFreeO: bool ean +isLast PosFnee (length: і nt): bo olean +get Po s Free(li: List lterator,pos:int,length:int, SpeedJeftJ nt, ru:Roadwsez) Jnt +JearCurveB oundsθ:v oid +addCurveBounds(s:Shape):void +pnocessStatsO÷void +init Stat sθ:voi d +get StatisticsO: Driv e IaneStatistics | ||
Createdwith Poseidon forUML Community Edition. Not for Commercial Use.
Figure 4.1: UML diagram: Road and Drivelane
represents all intersections, those with traffic lights and those without traffic lights
(NonTLJunction which is a subclass of Junction). The subclasses of SpecialNode
are EdgeNode and NetTunnel. At an EdgeNode road users will start and end their
trip.
4.2.3 Roadusers and how they move
Roaduser is the most super class representing all road users. It has 2 subclasses:
Automobile and Bicycle. Roaduser and Automobile are abstract classes. Automo-
bile has 2 subclasses: Car and Bus. The roadusers have an attribute pos, which
represents their current position on the lane. This position is changed by its ac-
cessors at other places, like in moveLane.