Skip to content

Commit 6e8b3ee

Browse files
committed
Remove old vehicle definition
Remove NodeVehicle trait
1 parent 158ef8d commit 6e8b3ee

File tree

7 files changed

+7
-69
lines changed

7 files changed

+7
-69
lines changed

src/simulation/messaging/message_broker.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use crate::simulation::messaging::messages::proto::{Vehicle, VehicleMessage};
2-
use crate::simulation::network::node::NodeVehicle;
32

43
use mpi::topology::SystemCommunicator;
54
use mpi::traits::{Communicator, Destination, Source};

src/simulation/messaging/messages.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use crate::simulation::messaging::messages::proto::{
1515
Activity, Agent, ExperimentalMessage, GenericRoute, Leg, NetworkRoute, Plan,
1616
TravelTimesMessage, Vehicle, VehicleMessage, VehicleType,
1717
};
18-
use crate::simulation::network::node::NodeVehicle;
1918
use crate::simulation::time_queue::EndTime;
2019

2120
// Include the `messages` module, which is generated from messages.proto.
@@ -125,18 +124,16 @@ impl Vehicle {
125124
fn agent(&self) -> &Agent {
126125
self.agent.as_ref().unwrap()
127126
}
128-
}
129127

130-
impl NodeVehicle for Vehicle {
131-
fn id(&self) -> usize {
128+
pub fn id(&self) -> usize {
132129
self.id as usize
133130
}
134131

135-
fn advance_route_index(&mut self) {
132+
pub fn advance_route_index(&mut self) {
136133
self.curr_route_elem += 1;
137134
}
138135

139-
fn curr_link_id(&self) -> Option<usize> {
136+
pub fn curr_link_id(&self) -> Option<usize> {
140137
let leg = self.agent().curr_leg();
141138
let route = leg.route.as_ref().unwrap();
142139
match route {
@@ -148,7 +145,7 @@ impl NodeVehicle for Vehicle {
148145
}
149146
}
150147

151-
fn is_current_link_last(&self) -> bool {
148+
pub fn is_current_link_last(&self) -> bool {
152149
let leg = self.agent().curr_leg();
153150
let route = leg.route.as_ref().unwrap();
154151
match route {
@@ -157,7 +154,7 @@ impl NodeVehicle for Vehicle {
157154
}
158155
}
159156

160-
fn mode(&self) -> &str {
157+
pub fn mode(&self) -> &str {
161158
self.mode.as_str()
162159
}
163160
}

src/simulation/network/link.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use crate::simulation::io::network::IOLink;
77
use crate::simulation::io::vehicle_definitions::VehicleDefinitions;
88
use crate::simulation::messaging::messages::proto::Vehicle;
99
use crate::simulation::network::flow_cap::Flowcap;
10-
use crate::simulation::network::node::NodeVehicle;
1110

1211
#[derive(Debug, Clone)]
1312
pub enum Link {

src/simulation/network/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
mod flow_cap;
22
pub mod link;
3+
pub mod network;
34
pub mod network_partition;
45
pub mod node;
5-
pub mod network;
66
pub mod routing_kit_network;
7-
mod vehicles;

src/simulation/network/node.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ use crate::simulation::messaging::messages::proto::Vehicle;
88
use crate::simulation::network::link::Link;
99
use crate::simulation::network::node::Node::{LocalNode, NeighbourNode};
1010

11-
pub trait NodeVehicle: Debug {
12-
fn id(&self) -> usize;
13-
fn advance_route_index(&mut self);
14-
fn curr_link_id(&self) -> Option<usize>;
15-
fn is_current_link_last(&self) -> bool;
16-
fn mode(&self) -> &str;
17-
}
18-
1911
#[derive(Debug, Clone)]
2012
pub enum Node {
2113
LocalNode(NodeImpl),

src/simulation/network/vehicles.rs

Lines changed: 0 additions & 48 deletions
This file was deleted.

src/simulation/simulation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::simulation::messaging::messages::proto::{
1010
};
1111
use crate::simulation::network::link::Link;
1212
use crate::simulation::network::network_partition::NetworkPartition;
13-
use crate::simulation::network::node::{ExitReason, NodeVehicle};
13+
use crate::simulation::network::node::ExitReason;
1414
use crate::simulation::population::Population;
1515
use crate::simulation::routing::router::Router;
1616
use crate::simulation::routing::walk_leg_updater::WalkLegUpdater;

0 commit comments

Comments
 (0)