35
Applying the Right Pattern
Controller
NewStrategy(FlowStrategy * Policy)
NextPhase()
FlowStrategy
NewPhase =
Policy.Next_Phase(ThisIntersection.currentState)
ThisIntersection.change_phase(NewPhase)
Intersection
OnDemand
Strategy
RoundRobin
Strategy
SelfAdapting
Strategy
LeftLead
Strategy
LeftLag
Strategy
Policy.setController(self)