-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
36 changed files
with
147 additions
and
3,430 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
assets/3-links/3-links-config-1.yml → tests/resources/3-links/3-links-config-1.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
assets/3-links/3-links-config-2.yml → tests/resources/3-links/3-links-config-2.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<events version="1.0"> | ||
<event time="32400" type="actend" person="100" link="link1" actType="home" /> | ||
<event time="32400" type="departure" person="100" link="link1" legMode="walk" /> | ||
<event time="32408" type="travelled" person="100" distance="10" mode="walk" /> | ||
<event time="32408" type="arrival" person="100" link="link1" legMode="walk" /> | ||
<event time="32408" type="actstart" person="100" link="link1" actType="car interaction" /> | ||
<event time="32409" type="actend" person="100" link="link1" actType="car interaction" /> | ||
<event time="32409" type="departure" person="100" link="link1" legMode="car" /> | ||
<event time="32409" type="PersonEntersVehicle" person="100" vehicle="100_car" /> | ||
<event time="32419" type="left link" link="link1" vehicle="100_car" /> | ||
<event time="32419" type="entered link" link="link2" vehicle="100_car" /> | ||
<event time="32519" type="left link" link="link2" vehicle="100_car" /> | ||
<event time="32519" type="entered link" link="link3" vehicle="100_car" /> | ||
<event time="32529" type="PersonLeavesVehicle" person="100" vehicle="100_car" /> | ||
<event time="32529" type="arrival" person="100" link="link3" legMode="car" /> | ||
<event time="32529" type="actstart" person="100" link="link3" actType="car interaction" /> | ||
<event time="32530" type="actend" person="100" link="link3" actType="car interaction" /> | ||
<event time="32530" type="departure" person="100" link="link3" legMode="walk" /> | ||
<event time="32546" type="travelled" person="100" distance="20" mode="walk" /> | ||
<event time="32546" type="arrival" person="100" link="link3" legMode="walk" /> | ||
<event time="32546" type="actstart" person="100" link="link3" actType="errands" /> | ||
</events> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
assets/adhoc_routing/no_updates/config-1.yml → ...ces/adhoc_routing/no_updates/config-1.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
assets/adhoc_routing/no_updates/config-2.yml → ...ces/adhoc_routing/no_updates/config-2.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
73 changes: 0 additions & 73 deletions
73
tests/resources/adhoc_routing/no_updates/output_events.xml
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
...s/adhoc_routing/with_updates/config-1.yml → ...s/adhoc_routing/with_updates/config-1.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...s/adhoc_routing/with_updates/config-2.yml → ...s/adhoc_routing/with_updates/config-2.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
147 changes: 0 additions & 147 deletions
147
tests/resources/adhoc_routing/with_updates/output_events.xml
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
tests/resources/three_link/multiple_agents/no_jam/output_events.xml
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
tests/resources/three_link/multiple_agents/with_jam/output_events.xml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use crate::test_simulation::{execute_sim, execute_sim_with_channels, TestSubscriber}; | ||
use rust_q_sim::simulation::config::CommandLineArgs; | ||
use rust_q_sim::simulation::messaging::communication::communicators::DummySimCommunicator; | ||
|
||
mod test_simulation; | ||
|
||
#[test] | ||
fn execute_3_links_single_part() { | ||
let config_args = CommandLineArgs { | ||
config_path: "./tests/resources/3-links/3-links-config-1.yml".to_string(), | ||
num_parts: None, | ||
}; | ||
|
||
execute_sim( | ||
DummySimCommunicator(), | ||
Box::new(TestSubscriber::new_with_events_from_file( | ||
"./tests/resources/3-links/expected_events.xml", | ||
)), | ||
config_args, | ||
); | ||
} | ||
|
||
#[test] | ||
fn execute_3_links_2_parts() { | ||
let config_args = CommandLineArgs { | ||
config_path: "./tests/resources/3-links/3-links-config-2.yml".to_string(), | ||
num_parts: None, | ||
}; | ||
|
||
execute_sim_with_channels(config_args, "./tests/resources/3-links/expected_events.xml"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
use crate::test_simulation::{execute_sim, execute_sim_with_channels, TestSubscriber}; | ||
use rust_q_sim::simulation::config::CommandLineArgs; | ||
use rust_q_sim::simulation::messaging::communication::communicators::DummySimCommunicator; | ||
|
||
mod test_simulation; | ||
|
||
#[test] | ||
fn execute_adhoc_routing_one_part_no_updates() { | ||
let config_args = CommandLineArgs { | ||
config_path: "./tests/resources/adhoc_routing/no_updates/config-1.yml".to_string(), | ||
num_parts: None, | ||
}; | ||
|
||
execute_sim( | ||
DummySimCommunicator(), | ||
Box::new(TestSubscriber::new_with_events_from_file( | ||
"./tests/resources/adhoc_routing/no_updates/expected_events.xml", | ||
)), | ||
config_args, | ||
); | ||
} | ||
|
||
#[test] | ||
fn execute_adhoc_routing_two_parts_no_updates() { | ||
let config_args = CommandLineArgs { | ||
config_path: "./tests/resources/adhoc_routing/no_updates/config-2.yml".to_string(), | ||
num_parts: None, | ||
}; | ||
|
||
execute_sim_with_channels( | ||
config_args, | ||
"./tests/resources/adhoc_routing/no_updates/expected_events.xml", | ||
); | ||
} | ||
|
||
#[test] | ||
fn execute_adhoc_routing_one_part_with_updates() { | ||
let config_args = CommandLineArgs { | ||
config_path: "./tests/resources/adhoc_routing/with_updates/config-1.yml".to_string(), | ||
num_parts: None, | ||
}; | ||
|
||
execute_sim( | ||
DummySimCommunicator(), | ||
Box::new(TestSubscriber::new_with_events_from_file( | ||
"./tests/resources/adhoc_routing/with_updates/expected_events.xml", | ||
)), | ||
config_args, | ||
); | ||
} | ||
|
||
#[test] | ||
fn execute_adhoc_routing_two_parts_with_updates() { | ||
let config_args = CommandLineArgs { | ||
config_path: "./tests/resources/adhoc_routing/with_updates/config-2.yml".to_string(), | ||
num_parts: None, | ||
}; | ||
|
||
execute_sim_with_channels( | ||
config_args, | ||
"./tests/resources/adhoc_routing/with_updates/expected_events.xml", | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.