11use crate :: simulation:: io:: vehicle_definitions:: VehicleDefinitions ;
22use crate :: simulation:: messaging:: events:: proto:: Event ;
33use crate :: simulation:: messaging:: events:: EventsPublisher ;
4+ use crate :: simulation:: messaging:: messages:: proto:: Vehicle ;
45use crate :: simulation:: network:: link:: Link ;
56use crate :: simulation:: network:: node:: Node :: { LocalNode , NeighbourNode } ;
67use std:: collections:: BTreeMap ;
@@ -61,13 +62,13 @@ impl Node {
6162 }
6263 }
6364
64- pub fn move_vehicles < V : NodeVehicle > (
65+ pub fn move_vehicles (
6566 & self ,
66- links : & mut BTreeMap < usize , Link < V > > ,
67+ links : & mut BTreeMap < usize , Link > ,
6768 now : u32 ,
6869 events : & mut EventsPublisher ,
6970 vehicle_definitions : Option < & VehicleDefinitions > ,
70- ) -> Vec < ExitReason < V > > {
71+ ) -> Vec < ExitReason > {
7172 match self {
7273 LocalNode ( n) => n. move_vehicles ( links, now, events, vehicle_definitions) ,
7374 NeighbourNode ( _) => {
@@ -102,9 +103,9 @@ pub struct NodeImpl {
102103 pub y : f32 ,
103104}
104105
105- pub enum ExitReason < V > {
106- FinishRoute ( V ) ,
107- ReachedBoundary ( V ) ,
106+ pub enum ExitReason {
107+ FinishRoute ( Vehicle ) ,
108+ ReachedBoundary ( Vehicle ) ,
108109}
109110
110111impl NodeImpl {
@@ -126,17 +127,17 @@ impl NodeImpl {
126127 self . out_links . push ( id) ;
127128 }
128129
129- pub fn move_vehicles < V : NodeVehicle > (
130+ pub fn move_vehicles (
130131 & self ,
131- links : & mut BTreeMap < usize , Link < V > > ,
132+ links : & mut BTreeMap < usize , Link > ,
132133 now : u32 ,
133134 events : & mut EventsPublisher ,
134135 vehicle_definitions : Option < & VehicleDefinitions > ,
135- ) -> Vec < ExitReason < V > > {
136+ ) -> Vec < ExitReason > {
136137 let mut exited_vehicles = Vec :: new ( ) ;
137138
138139 for in_link_index in & self . in_links {
139- let vehicles: Vec < V > = match links. get_mut ( in_link_index) . unwrap ( ) {
140+ let vehicles: Vec < Vehicle > = match links. get_mut ( in_link_index) . unwrap ( ) {
140141 Link :: LocalLink ( link) => link. pop_front ( now) ,
141142 Link :: SplitInLink ( split_link) => split_link. local_link_mut ( ) . pop_front ( now) ,
142143 Link :: SplitOutLink ( _) => panic ! ( "No split out link expected as in link of a node." ) ,
@@ -170,12 +171,12 @@ impl NodeImpl {
170171 exited_vehicles
171172 }
172173
173- fn move_vehicle < V : NodeVehicle > (
174+ fn move_vehicle (
174175 & self ,
175- links : & mut BTreeMap < usize , Link < V > > ,
176+ links : & mut BTreeMap < usize , Link > ,
176177 out_link_id : usize ,
177- vehicle : V ,
178- exited_vehicles : & mut Vec < ExitReason < V > > ,
178+ vehicle : Vehicle ,
179+ exited_vehicles : & mut Vec < ExitReason > ,
179180 now : u32 ,
180181 events : & mut EventsPublisher ,
181182 vehicle_definitions : Option < & VehicleDefinitions > ,
0 commit comments