diff --git a/daisi/scenarios/cpps/default.yml b/daisi/scenarios/cpps/default.yml index 7eec6633..2940f776 100644 --- a/daisi/scenarios/cpps/default.yml +++ b/daisi/scenarios/cpps/default.yml @@ -1,8 +1,8 @@ title: CPPS Default Scenario version: 0.1 -stop_time: 5000 +stop_time: 5000s random_seed: 42 -default_delay: 5 +default_delay: 5s # outdated/unused fields # only present until Manager switches to new scenariofile parser as well @@ -104,35 +104,35 @@ scenario_sequence: - amr: entity: amr friendly_name: FPckg - start_time: 0 + start_time: 0s spawn_distribution: type: absolute number: 3 - amr: entity: amr friendly_name: SPckg - start_time: 0 + start_time: 0s spawn_distribution: type: absolute number: 3 - amr: entity: amr friendly_name: WEuro - start_time: 0 + start_time: 0s spawn_distribution: type: absolute number: 3 - amr: entity: amr friendly_name: SEuro - start_time: 0 + start_time: 0s spawn_distribution: type: absolute number: 3 - mf: entity: mf friendly_name: mf1 - start_time: 0 + start_time: 0s spawn_distribution: type: gaussian mean: 100 diff --git a/daisi/scenarios/entity_search/example.yml b/daisi/scenarios/entity_search/example.yml index b63ef7f0..2a42c086 100644 --- a/daisi/scenarios/entity_search/example.yml +++ b/daisi/scenarios/entity_search/example.yml @@ -1,9 +1,9 @@ # required title: Entity Search example with 10 attributes version: 0.1 -stop_time: 3600000 # 1 hour +stop_time: 1h random_seed: 2 -default_delay: 5000 +default_delay: 5s # outdated/unused fields # only present until Manager switches to new scenariofile parser as well diff --git a/daisi/scenarios/minhton/default.yml b/daisi/scenarios/minhton/default.yml index 8a863f98..acb527c2 100644 --- a/daisi/scenarios/minhton/default.yml +++ b/daisi/scenarios/minhton/default.yml @@ -1,8 +1,8 @@ title: MINHTON default scenario version: 0.1 -stop_time: 10000000 +stop_time: 10000s random_seed: 1 -default_delay: 5000 +default_delay: 5s # outdated/unused fields # only present until Manager switches to new scenariofile parser as well diff --git a/daisi/scenarios/natter/default.yml b/daisi/scenarios/natter/default.yml index 6b87b05e..0e465c4f 100644 --- a/daisi/scenarios/natter/default.yml +++ b/daisi/scenarios/natter/default.yml @@ -1,8 +1,8 @@ title: Test version: 0.1 -stop_time: 5000 +stop_time: 5000s random_seed: 1 -default_delay: 500 +default_delay: 0.5s # outdated/unused fields # only present until Manager switches to new scenariofile parser as well @@ -18,6 +18,6 @@ scenario_sequence: mode: minhton - type: publish number: 5 - delay: 0 + delay: 0s mode: random # random, sequential message_size: 100 # in bytes diff --git a/daisi/scenarios/sola/default.yml b/daisi/scenarios/sola/default.yml index 6f56230b..f8fa262f 100644 --- a/daisi/scenarios/sola/default.yml +++ b/daisi/scenarios/sola/default.yml @@ -1,8 +1,8 @@ title: SOLA default scenario version: 0.1 -stop_time: 4294967296 +stop_time: 4294967296ms random_seed: 1 -default_delay: 500 +default_delay: 0.5s # outdated/unused fields # only present until Manager switches to new scenariofile parser as well @@ -14,14 +14,14 @@ number_nodes: 3 scenario_sequence: - type: start_sola - delay: 1000 + delay: 1s - type: delay - delay: 0 + delay: 0s - type: subscribe_topic topic: "helloworld" - delay: 1000 + delay: 1s - type: delay - delay: 0 + delay: 0s - type: publish topic: "helloworld" message_size: 100 # bytes diff --git a/daisi/src/cpps/common/cpps_manager.cpp b/daisi/src/cpps/common/cpps_manager.cpp index fe5cb7b5..61123914 100644 --- a/daisi/src/cpps/common/cpps_manager.cpp +++ b/daisi/src/cpps/common/cpps_manager.cpp @@ -145,7 +145,7 @@ void CppsManager::setup() { void CppsManager::initialSpawn() { uint32_t previous_index = 0; - while (!spawn_info_.empty() && spawn_info_.top().start_time == 0) { + while (!spawn_info_.empty() && spawn_info_.top().start_time == ns3::Time(0)) { auto info = spawn_info_.top(); spawn_info_.pop(); @@ -514,24 +514,24 @@ void CppsManager::scheduleMaterialFlow(const SpawnInfoScenario &info) { void CppsManager::scheduleEvents() { Simulator::Schedule(Seconds(1), &CppsManager::clearFinishedMaterialFlows, this); - uint64_t current_time = Simulator::Now().GetSeconds(); - uint64_t delay = scenario_.default_delay; + ns3::Time current_time = Simulator::Now(); + const ns3::Time delay = scenario_.default_delay; for (auto i = 0U; i < scenario_.initial_number_of_amrs; i++) { current_time += delay; - Simulator::ScheduleWithContext(this->amrs_.Get(i)->GetId(), Seconds(current_time), - &CppsManager::initAMR, this, i); + Simulator::ScheduleWithContext(this->amrs_.Get(i)->GetId(), current_time, &CppsManager::initAMR, + this, i); } for (auto i = 0U; i < scenario_.initial_number_of_amrs; i++) { current_time += delay; - Simulator::ScheduleWithContext(this->amrs_.Get(i)->GetId(), Seconds(current_time), + Simulator::ScheduleWithContext(this->amrs_.Get(i)->GetId(), current_time, &CppsManager::connectAMR, this, i); } for (auto i = 0U; i < scenario_.initial_number_of_amrs; i++) { current_time += delay; - Simulator::ScheduleWithContext(this->amrs_.Get(i)->GetId(), Seconds(current_time), + Simulator::ScheduleWithContext(this->amrs_.Get(i)->GetId(), current_time, &CppsManager::startAMR, this, i); } @@ -540,8 +540,8 @@ void CppsManager::scheduleEvents() { auto info = schedule_info_.top(); schedule_info_.pop(); current_time += delay; - Simulator::Schedule(Seconds(current_time + info.start_time), &CppsManager::scheduleMaterialFlow, - this, info); + Simulator::Schedule(current_time + info.start_time, &CppsManager::scheduleMaterialFlow, this, + info); } } diff --git a/daisi/src/cpps/common/scenariofile/CMakeLists.txt b/daisi/src/cpps/common/scenariofile/CMakeLists.txt index d96f5059..a56c3331 100644 --- a/daisi/src/cpps/common/scenariofile/CMakeLists.txt +++ b/daisi/src/cpps/common/scenariofile/CMakeLists.txt @@ -45,4 +45,5 @@ target_link_libraries(daisi_cpps_common_scenariofile_spawn_info_scenario INTERFACE daisi_manager_scenariofile_component yaml-cpp + ns3::libcore ) diff --git a/daisi/src/cpps/common/scenariofile/spawn_info_scenario.h b/daisi/src/cpps/common/scenariofile/spawn_info_scenario.h index fac1c777..beefa20c 100644 --- a/daisi/src/cpps/common/scenariofile/spawn_info_scenario.h +++ b/daisi/src/cpps/common/scenariofile/spawn_info_scenario.h @@ -18,6 +18,7 @@ #define DAISI_CPPS_MANAGER_SPAWN_INFO_SCENARIO_H_ #include "manager/scenariofile_component.h" +#include "ns3/core-module.h" namespace daisi::cpps { @@ -57,14 +58,14 @@ struct SpawnDistributionScenario { struct SpawnInfoScenario { std::string entity; std::string friendly_name; - uint64_t start_time; + ns3::Time start_time; SpawnDistributionScenario spawn_distribution; void parse(YAML::Node node) { SERIALIZE_VAR(entity); SERIALIZE_VAR(friendly_name); - SERIALIZE_VAR(start_time); + SERIALIZE_NS3_TIME(start_time); SERIALIZE_VAR(spawn_distribution); } diff --git a/daisi/src/manager/CMakeLists.txt b/daisi/src/manager/CMakeLists.txt index a8e7849a..0651c118 100644 --- a/daisi/src/manager/CMakeLists.txt +++ b/daisi/src/manager/CMakeLists.txt @@ -56,6 +56,7 @@ target_link_libraries(daisi_manager_general_scenariofile INTERFACE daisi_manager_scenariofile_component yaml-cpp + ns3::libcore ) add_library(daisi_manager_core_network) diff --git a/daisi/src/manager/general_scenariofile.h b/daisi/src/manager/general_scenariofile.h index c211a01e..0fd13ef3 100644 --- a/daisi/src/manager/general_scenariofile.h +++ b/daisi/src/manager/general_scenariofile.h @@ -20,6 +20,7 @@ #include #include +#include "ns3/core-module.h" #include "scenariofile_component.h" namespace daisi { @@ -35,8 +36,8 @@ struct GeneralScenariofile { SERIALIZE_VAR(random_seed); - SERIALIZE_VAR(stop_time); - SERIALIZE_VAR(default_delay); + SERIALIZE_NS3_TIME(stop_time); + SERIALIZE_NS3_TIME(default_delay); SERIALIZE_VAR(output_path); } @@ -69,8 +70,8 @@ struct GeneralScenariofile { uint64_t random_seed = 0; // simulation information - uint64_t stop_time = 0; - uint64_t default_delay = 0; + ns3::Time stop_time; + ns3::Time default_delay; std::optional output_path; diff --git a/daisi/src/minhton-ns3/CMakeLists.txt b/daisi/src/minhton-ns3/CMakeLists.txt index f38d26c2..50e7f79a 100644 --- a/daisi/src/minhton-ns3/CMakeLists.txt +++ b/daisi/src/minhton-ns3/CMakeLists.txt @@ -86,6 +86,7 @@ target_sources(daisi_minhton_scenario_steps INTERFACE scenario_steps.h) target_link_libraries(daisi_minhton_scenario_steps INTERFACE daisi_manager_scenariofile_component + ns3::libcore ) target_include_directories(daisi_minhton_scenario_steps INTERFACE diff --git a/daisi/src/minhton-ns3/minhton_manager_scheduler.cpp b/daisi/src/minhton-ns3/minhton_manager_scheduler.cpp index d2fd6573..a15df2a2 100644 --- a/daisi/src/minhton-ns3/minhton_manager_scheduler.cpp +++ b/daisi/src/minhton-ns3/minhton_manager_scheduler.cpp @@ -31,7 +31,7 @@ MinhtonManager::Scheduler::Scheduler(MinhtonManager &manager) uniform_zero_one_distribution_(std::uniform_real_distribution(0.0, 1.0)){}; void MinhtonManager::Scheduler::schedule() { - uint64_t current_time = 0; + ns3::Time current_time = ns3::Time(0); parseNodeAttributes(); parseRequests(); @@ -57,27 +57,28 @@ void MinhtonManager::Scheduler::schedule() { } } -void MinhtonManager::Scheduler::schedule(Time step, uint64_t ¤t_time) { +void MinhtonManager::Scheduler::schedule(Time step, ns3::Time ¤t_time) { current_time += step.time; } -void MinhtonManager::Scheduler::schedule(JoinMany step, uint64_t ¤t_time) { - const uint64_t join_many_delay = manager_.scenariofile_.default_delay + step.delay.value_or(0); +void MinhtonManager::Scheduler::schedule(JoinMany step, ns3::Time ¤t_time) { + const ns3::Time join_many_delay = + manager_.scenariofile_.default_delay + step.delay.value_or(ns3::Time(0)); current_time += join_many_delay; if (step.mode == "random") { for (uint64_t i = 0; i < step.number; i++) { - Simulator::Schedule(MilliSeconds(current_time + join_many_delay * i), + Simulator::Schedule(current_time + join_many_delay * i, &MinhtonManager::Scheduler::executeOneRandomJoin, this); } } else if (step.mode == "root") { for (uint64_t i = 0; i < step.number; i++) { - Simulator::Schedule(MilliSeconds(current_time + join_many_delay * i), + Simulator::Schedule(current_time + join_many_delay * i, &MinhtonManager::Scheduler::executeOneJoinOnRoot, this); } } else if (step.mode == "discover") { for (uint64_t i = 0; i < step.number; i++) { - Simulator::Schedule(MilliSeconds(current_time + join_many_delay * i), + Simulator::Schedule(current_time + join_many_delay * i, &MinhtonManager::Scheduler::executeOneJoinDiscover, this); } } else { @@ -87,17 +88,16 @@ void MinhtonManager::Scheduler::schedule(JoinMany step, uint64_t ¤t_time) current_time += join_many_delay * (step.number - 1); } -void MinhtonManager::Scheduler::schedule(JoinOne step, uint64_t ¤t_time) { - const uint64_t join_one_delay = manager_.scenariofile_.default_delay + step.delay.value_or(0); +void MinhtonManager::Scheduler::schedule(JoinOne step, ns3::Time ¤t_time) { + const ns3::Time join_one_delay = + manager_.scenariofile_.default_delay + step.delay.value_or(ns3::Time(0)); current_time += join_one_delay; if (step.level && step.number) { - Simulator::Schedule(MilliSeconds(current_time), - &MinhtonManager::Scheduler::executeOneJoinByPosition, this, + Simulator::Schedule(current_time, &MinhtonManager::Scheduler::executeOneJoinByPosition, this, step.level.value(), step.number.value()); } else if (step.index) { - Simulator::Schedule(MilliSeconds(current_time), - &MinhtonManager::Scheduler::executeOneJoinByIndex, this, + Simulator::Schedule(current_time, &MinhtonManager::Scheduler::executeOneJoinByIndex, this, step.index.value()); } else { throw std::invalid_argument( @@ -105,18 +105,19 @@ void MinhtonManager::Scheduler::schedule(JoinOne step, uint64_t ¤t_time) { } } -void MinhtonManager::Scheduler::schedule(LeaveMany step, uint64_t ¤t_time) { - const uint64_t leave_many_delay = manager_.scenariofile_.default_delay + step.delay.value_or(0); +void MinhtonManager::Scheduler::schedule(LeaveMany step, ns3::Time ¤t_time) { + const ns3::Time leave_many_delay = + manager_.scenariofile_.default_delay + step.delay.value_or(ns3::Time(0)); current_time += leave_many_delay; if (step.mode == "random") { for (uint64_t i = 0; i < step.number; i++) { - Simulator::Schedule(MilliSeconds(current_time + leave_many_delay * i), + Simulator::Schedule(current_time + leave_many_delay * i, &MinhtonManager::Scheduler::executeOneRandomLeave, this); } } else if (step.mode == "root") { for (uint64_t i = 0; i < step.number; i++) { - Simulator::Schedule(MilliSeconds(current_time + leave_many_delay * i), + Simulator::Schedule(current_time + leave_many_delay * i, &MinhtonManager::Scheduler::executeOneLeaveOnRoot, this); } } else { @@ -126,17 +127,16 @@ void MinhtonManager::Scheduler::schedule(LeaveMany step, uint64_t ¤t_time) current_time += leave_many_delay * (step.number - 1); } -void MinhtonManager::Scheduler::schedule(LeaveOne step, uint64_t ¤t_time) { - const uint64_t leave_one_delay = manager_.scenariofile_.default_delay + step.delay.value_or(0); +void MinhtonManager::Scheduler::schedule(LeaveOne step, ns3::Time ¤t_time) { + const ns3::Time leave_one_delay = + manager_.scenariofile_.default_delay + step.delay.value_or(ns3::Time(0)); current_time += leave_one_delay; if (step.level && step.number) { - Simulator::Schedule(MilliSeconds(current_time), - &MinhtonManager::Scheduler::executeOneLeaveByPosition, this, + Simulator::Schedule(current_time, &MinhtonManager::Scheduler::executeOneLeaveByPosition, this, step.level.value(), step.number.value()); } else if (step.index) { - Simulator::Schedule(MilliSeconds(current_time), - &MinhtonManager::Scheduler::executeOneLeaveByIndex, this, + Simulator::Schedule(current_time, &MinhtonManager::Scheduler::executeOneLeaveByIndex, this, step.index.value()); } else { throw std::invalid_argument( @@ -144,46 +144,47 @@ void MinhtonManager::Scheduler::schedule(LeaveOne step, uint64_t ¤t_time) } } -void MinhtonManager::Scheduler::schedule(SearchAll step, uint64_t ¤t_time) { - const uint64_t search_all_delay = manager_.scenariofile_.default_delay + step.delay.value_or(0); +void MinhtonManager::Scheduler::schedule(SearchAll step, ns3::Time ¤t_time) { + const ns3::Time search_all_delay = + manager_.scenariofile_.default_delay + step.delay.value_or(ns3::Time(0)); - Simulator::Schedule(MilliSeconds(current_time + search_all_delay), + Simulator::Schedule(current_time + search_all_delay, &MinhtonManager::Scheduler::scheduleSearchExactAll, this, search_all_delay); current_time += search_all_delay * (manager_.getNumberOfNodes() + 1); } -void MinhtonManager::Scheduler::schedule(SearchMany step, uint64_t ¤t_time) { - const uint64_t search_many_delay = manager_.scenariofile_.default_delay + step.delay.value_or(0); +void MinhtonManager::Scheduler::schedule(SearchMany step, ns3::Time ¤t_time) { + const ns3::Time search_many_delay = + manager_.scenariofile_.default_delay + step.delay.value_or(ns3::Time(0)); - Simulator::Schedule(MilliSeconds(current_time), - &MinhtonManager::Scheduler::scheduleSearchExactMany, this, search_many_delay, - step.number); + Simulator::Schedule(current_time, &MinhtonManager::Scheduler::scheduleSearchExactMany, this, + search_many_delay, step.number); current_time += search_many_delay * (step.number + 1) - manager_.scenariofile_.default_delay; } -void MinhtonManager::Scheduler::schedule(FailMany step, uint64_t ¤t_time) { - const uint64_t fail_many_delay = manager_.scenariofile_.default_delay + step.delay.value_or(0); +void MinhtonManager::Scheduler::schedule(FailMany step, ns3::Time ¤t_time) { + const ns3::Time fail_many_delay = + manager_.scenariofile_.default_delay + step.delay.value_or(ns3::Time(0)); current_time += fail_many_delay; for (uint64_t i = 0; i < step.number; i++) { - Simulator::Schedule(MilliSeconds(current_time + fail_many_delay * i), + Simulator::Schedule(current_time + fail_many_delay * i, &MinhtonManager::Scheduler::executeOneRandomFail, this); } current_time += fail_many_delay * (step.number - 1); } -void MinhtonManager::Scheduler::schedule(FailOne step, uint64_t ¤t_time) { - const uint64_t fail_one_delay = manager_.scenariofile_.default_delay + step.delay.value_or(0); +void MinhtonManager::Scheduler::schedule(FailOne step, ns3::Time ¤t_time) { + const ns3::Time fail_one_delay = + manager_.scenariofile_.default_delay + step.delay.value_or(ns3::Time(0)); current_time += fail_one_delay; if (step.level && step.number) { - Simulator::Schedule(MilliSeconds(current_time), - &MinhtonManager::Scheduler::executeOneFailByPosition, this, + Simulator::Schedule(current_time, &MinhtonManager::Scheduler::executeOneFailByPosition, this, step.level.value(), step.number.value()); } else if (step.index) { - Simulator::Schedule(MilliSeconds(current_time), - &MinhtonManager::Scheduler::executeOneFailByIndex, this, + Simulator::Schedule(current_time, &MinhtonManager::Scheduler::executeOneFailByIndex, this, step.index.value()); } else { throw std::invalid_argument( @@ -191,9 +192,9 @@ void MinhtonManager::Scheduler::schedule(FailOne step, uint64_t ¤t_time) { } } -void MinhtonManager::Scheduler::schedule(MixedExecution step, uint64_t ¤t_time) { - const uint64_t mixed_execution_delay = - manager_.scenariofile_.default_delay + step.delay.value_or(0); +void MinhtonManager::Scheduler::schedule(MixedExecution step, ns3::Time ¤t_time) { + const ns3::Time mixed_execution_delay = + manager_.scenariofile_.default_delay + step.delay.value_or(ns3::Time(0)); this->scheduleMixedExecution(step.join_number, step.leave_number, step.search_number, current_time, mixed_execution_delay); @@ -201,21 +202,21 @@ void MinhtonManager::Scheduler::schedule(MixedExecution step, uint64_t ¤t_ mixed_execution_delay * (step.join_number + step.leave_number + step.search_number); } -void MinhtonManager::Scheduler::schedule(ValidateLeave step, uint64_t ¤t_time) { - const uint64_t validate_leave_delay = - manager_.scenariofile_.default_delay + step.delay.value_or(0); +void MinhtonManager::Scheduler::schedule(ValidateLeave step, ns3::Time ¤t_time) { + const ns3::Time validate_leave_delay = + manager_.scenariofile_.default_delay + step.delay.value_or(ns3::Time(0)); current_time += validate_leave_delay; - Simulator::Schedule(MilliSeconds(current_time), &MinhtonManager::Scheduler::scheduleValidateLeave, - this, validate_leave_delay); + Simulator::Schedule(current_time, &MinhtonManager::Scheduler::scheduleValidateLeave, this, + validate_leave_delay); // upper bound, might be less though // times 2 for each leave and join current_time += validate_leave_delay * (manager_.getNumberOfNodes() - 1) * 2; } -void MinhtonManager::Scheduler::schedule(FindQuery step, uint64_t ¤t_time) { +void MinhtonManager::Scheduler::schedule(FindQuery step, ns3::Time ¤t_time) { minhton::FindQuery query(step.query, step.scope); minhton::NodeInfo requesting_node; @@ -225,20 +226,19 @@ void MinhtonManager::Scheduler::schedule(FindQuery step, uint64_t ¤t_time) query.setValidityThreshold(step.validity_threshold); query.setSelection(minhton::FindQuery::FindQuerySelection::kSelectUnspecific); - Simulator::Schedule(MilliSeconds(current_time), &MinhtonManager::Scheduler::executeFindQuery, - this, query); + Simulator::Schedule(current_time, &MinhtonManager::Scheduler::executeFindQuery, this, query); current_time += manager_.scenariofile_.default_delay; } -void MinhtonManager::Scheduler::schedule(RequestCountdown step, uint64_t ¤t_time) { - Simulator::Schedule(MilliSeconds(current_time), - &MinhtonManager::Scheduler::activateRequestCountdown, this, step.number); +void MinhtonManager::Scheduler::schedule(RequestCountdown step, ns3::Time ¤t_time) { + Simulator::Schedule(current_time, &MinhtonManager::Scheduler::activateRequestCountdown, this, + step.number); } -void MinhtonManager::Scheduler::schedule(StaticBuild step, uint64_t ¤t_time) { - Simulator::Schedule(MilliSeconds(current_time), - &MinhtonManager::Scheduler::executeStaticNetworkBuild, this, step.number); +void MinhtonManager::Scheduler::schedule(StaticBuild step, ns3::Time ¤t_time) { + Simulator::Schedule(current_time, &MinhtonManager::Scheduler::executeStaticNetworkBuild, this, + step.number); current_time += manager_.scenariofile_.default_delay; } diff --git a/daisi/src/minhton-ns3/minhton_manager_scheduler.h b/daisi/src/minhton-ns3/minhton_manager_scheduler.h index 1e7f5797..42e20bec 100644 --- a/daisi/src/minhton-ns3/minhton_manager_scheduler.h +++ b/daisi/src/minhton-ns3/minhton_manager_scheduler.h @@ -58,8 +58,8 @@ class MinhtonManager::Scheduler { void initiateLeaveNow(uint64_t node_to_leave_to_index); void initiateFailureNow(uint64_t node_to_fail_to_index); - void scheduleSearchExactAll(uint64_t delay); - void scheduleSearchExactMany(uint64_t delay, uint32_t number); + void scheduleSearchExactAll(ns3::Time delay); + void scheduleSearchExactMany(ns3::Time delay, uint32_t number); void executeOneSearchExact(ns3::Ptr src_app, uint32_t dest_level, uint32_t dest_number); void executeOneRandomSearchExact(); @@ -67,8 +67,8 @@ class MinhtonManager::Scheduler { void executeStaticNetworkBuild(uint32_t number); void scheduleMixedExecution(uint64_t join_num, uint64_t leave_num, uint64_t search_num, - uint64_t current_time, uint64_t delay); - void scheduleValidateLeave(uint64_t delay); + ns3::Time current_time, ns3::Time delay); + void scheduleValidateLeave(ns3::Time delay); uint64_t getRootIndex(); std::vector getInitializedNodeIndexes(); @@ -81,20 +81,20 @@ class MinhtonManager::Scheduler { uint64_t latest_root_index_ = 0; // parsing - void schedule(JoinOne step, uint64_t ¤t_time); - void schedule(JoinMany step, uint64_t ¤t_time); - void schedule(LeaveOne step, uint64_t ¤t_time); - void schedule(LeaveMany step, uint64_t ¤t_time); - void schedule(SearchMany step, uint64_t ¤t_time); - void schedule(SearchAll step, uint64_t ¤t_time); - void schedule(FailOne step, uint64_t ¤t_time); - void schedule(FailMany step, uint64_t ¤t_time); - void schedule(MixedExecution step, uint64_t ¤t_time); - void schedule(ValidateLeave step, uint64_t ¤t_time); - void schedule(FindQuery step, uint64_t ¤t_time); - void schedule(RequestCountdown step, uint64_t ¤t_time); - void schedule(Time step, uint64_t ¤t_time); - void schedule(StaticBuild step, uint64_t ¤t_time); + void schedule(JoinOne step, ns3::Time ¤t_time); + void schedule(JoinMany step, ns3::Time ¤t_time); + void schedule(LeaveOne step, ns3::Time ¤t_time); + void schedule(LeaveMany step, ns3::Time ¤t_time); + void schedule(SearchMany step, ns3::Time ¤t_time); + void schedule(SearchAll step, ns3::Time ¤t_time); + void schedule(FailOne step, ns3::Time ¤t_time); + void schedule(FailMany step, ns3::Time ¤t_time); + void schedule(MixedExecution step, ns3::Time ¤t_time); + void schedule(ValidateLeave step, ns3::Time ¤t_time); + void schedule(FindQuery step, ns3::Time ¤t_time); + void schedule(RequestCountdown step, ns3::Time ¤t_time); + void schedule(Time step, ns3::Time ¤t_time); + void schedule(StaticBuild step, ns3::Time ¤t_time); void parseNodeAttributes(); void setRequestNodeSetup(RandomNode random); diff --git a/daisi/src/minhton-ns3/minhton_manager_scheduler_helper.cpp b/daisi/src/minhton-ns3/minhton_manager_scheduler_helper.cpp index 241b134b..292e86ef 100644 --- a/daisi/src/minhton-ns3/minhton_manager_scheduler_helper.cpp +++ b/daisi/src/minhton-ns3/minhton_manager_scheduler_helper.cpp @@ -68,8 +68,8 @@ void MinhtonManager::Scheduler::setupRequestingNodes() { } void MinhtonManager::Scheduler::scheduleMixedExecution(uint64_t join_num, uint64_t leave_num, - uint64_t search_num, uint64_t current_time, - uint64_t delay) { + uint64_t search_num, ns3::Time current_time, + ns3::Time delay) { std::vector random_sequence; std::vector join_seq(join_num); std::vector leave_seq(leave_num); @@ -89,14 +89,12 @@ void MinhtonManager::Scheduler::scheduleMixedExecution(uint64_t join_num, uint64 current_time += delay; if (type == 0) { // join - Simulator::Schedule(MilliSeconds(current_time), - &MinhtonManager::Scheduler::executeOneRandomJoin, this); + Simulator::Schedule(current_time, &MinhtonManager::Scheduler::executeOneRandomJoin, this); } else if (type == 1) { // leave - Simulator::Schedule(MilliSeconds(current_time), - &MinhtonManager::Scheduler::executeOneRandomLeave, this); + Simulator::Schedule(current_time, &MinhtonManager::Scheduler::executeOneRandomLeave, this); } else { // search - Simulator::Schedule(MilliSeconds(current_time), - &MinhtonManager::Scheduler::executeOneRandomSearchExact, this); + Simulator::Schedule(current_time, &MinhtonManager::Scheduler::executeOneRandomSearchExact, + this); } } } @@ -333,7 +331,7 @@ void MinhtonManager::Scheduler::initiateFailureNow(uint64_t node_to_fail_to_inde failing_app->StopApplication(); } -void MinhtonManager::Scheduler::scheduleSearchExactAll(uint64_t delay) { +void MinhtonManager::Scheduler::scheduleSearchExactAll(ns3::Time delay) { uint64_t counter = 0; for (uint64_t i = 0; i < manager_.node_container_.GetN(); i++) { @@ -347,18 +345,17 @@ void MinhtonManager::Scheduler::scheduleSearchExactAll(uint64_t delay) { ->GetObject() ->getNodeInfo(); if ((i != k) && node_info_k.isInitialized()) { - uint64_t current_delay = ++counter * delay; - Simulator::Schedule(MilliSeconds(current_delay), - &MinhtonManager::Scheduler::executeOneSearchExact, this, app_i, - node_info_k.getLevel(), node_info_k.getNumber()); + ns3::Time current_delay = ++counter * delay; + Simulator::Schedule(current_delay, &MinhtonManager::Scheduler::executeOneSearchExact, + this, app_i, node_info_k.getLevel(), node_info_k.getNumber()); } } } } } -void MinhtonManager::Scheduler::scheduleSearchExactMany(uint64_t delay, uint32_t number) { - uint64_t current_delay = 0; +void MinhtonManager::Scheduler::scheduleSearchExactMany(ns3::Time delay, uint32_t number) { + ns3::Time current_delay = ns3::Time(0); auto existing_positions_tuple = this->getExistingPositions(); auto existing_positions = std::get<1>(existing_positions_tuple); @@ -382,9 +379,8 @@ void MinhtonManager::Scheduler::scheduleSearchExactMany(uint64_t delay, uint32_t uint16_t node_end_level = std::get<0>(existing_positions[end]); uint16_t node_end_number = std::get<1>(existing_positions[end]); - Simulator::Schedule(MilliSeconds(current_delay), - &MinhtonManager::Scheduler::executeOneSearchExact, this, app_start, - node_end_level, node_end_number); + Simulator::Schedule(current_delay, &MinhtonManager::Scheduler::executeOneSearchExact, this, + app_start, node_end_level, node_end_number); } } } @@ -513,16 +509,16 @@ uint64_t MinhtonManager::Scheduler::getRootIndex() { throw std::logic_error("No initialized root node found. Manager-Scheduling Error"); } -void MinhtonManager::Scheduler::scheduleValidateLeave(uint64_t delay) { +void MinhtonManager::Scheduler::scheduleValidateLeave(ns3::Time delay) { for (uint64_t i = 0; i < manager_.getNumberOfNodes(); i++) { auto app = manager_.node_container_.Get(i)->GetApplication(0)->GetObject(); const minhton::NodeInfo node_info = app->getNodeInfo(); if (node_info.isInitialized()) { - Simulator::Schedule(MilliSeconds((2 * i + 1) * delay), - &MinhtonManager::Scheduler::executeOneLeaveByIndex, this, i); - Simulator::Schedule(MilliSeconds((2 * i + 2) * delay), - &MinhtonManager::Scheduler::executeOneRandomJoin, this); + Simulator::Schedule((2 * i + 1) * delay, &MinhtonManager::Scheduler::executeOneLeaveByIndex, + this, i); + Simulator::Schedule((2 * i + 2) * delay, &MinhtonManager::Scheduler::executeOneRandomJoin, + this); } } } diff --git a/daisi/src/minhton-ns3/scenario_steps.h b/daisi/src/minhton-ns3/scenario_steps.h index 93515ef7..b24dd44b 100644 --- a/daisi/src/minhton-ns3/scenario_steps.h +++ b/daisi/src/minhton-ns3/scenario_steps.h @@ -22,19 +22,20 @@ #include #include "manager/scenariofile_component.h" +#include "ns3/core-module.h" namespace daisi::minhton_ns3 { struct JoinOne { static std::string typeName() { return "join-one"; } - std::optional delay; + std::optional delay; std::optional level; std::optional number; std::optional index; void parse(YAML::Node node) { - SERIALIZE_VAR(delay); + SERIALIZE_NS3_TIME_OPTIONAL(delay); SERIALIZE_VAR(level); SERIALIZE_VAR(number); SERIALIZE_VAR(index); @@ -44,12 +45,12 @@ struct JoinOne { struct JoinMany { static std::string typeName() { return "join-many"; } - std::optional delay; + std::optional delay; uint32_t number; std::string mode; void parse(YAML::Node node) { - SERIALIZE_VAR(delay); + SERIALIZE_NS3_TIME_OPTIONAL(delay); SERIALIZE_VAR(number); SERIALIZE_VAR(mode); } @@ -58,13 +59,13 @@ struct JoinMany { struct LeaveOne { static std::string typeName() { return "leave-one"; } - std::optional delay; + std::optional delay; std::optional level; std::optional number; std::optional index; void parse(YAML::Node node) { - SERIALIZE_VAR(delay); + SERIALIZE_NS3_TIME_OPTIONAL(delay); SERIALIZE_VAR(level); SERIALIZE_VAR(number); SERIALIZE_VAR(index); @@ -74,12 +75,12 @@ struct LeaveOne { struct LeaveMany { static std::string typeName() { return "leave-many"; } - std::optional delay; + std::optional delay; uint32_t number; std::string mode; void parse(YAML::Node node) { - SERIALIZE_VAR(delay); + SERIALIZE_NS3_TIME_OPTIONAL(delay); SERIALIZE_VAR(number); SERIALIZE_VAR(mode); } @@ -88,11 +89,11 @@ struct LeaveMany { struct SearchMany { static std::string typeName() { return "search-many"; } - std::optional delay; + std::optional delay; uint32_t number; void parse(YAML::Node node) { - SERIALIZE_VAR(delay); + SERIALIZE_NS3_TIME_OPTIONAL(delay); SERIALIZE_VAR(number); } }; @@ -100,21 +101,21 @@ struct SearchMany { struct SearchAll { static std::string typeName() { return "search-all"; } - std::optional delay; + std::optional delay; - void parse(YAML::Node node) { SERIALIZE_VAR(delay); } + void parse(YAML::Node node) { SERIALIZE_NS3_TIME_OPTIONAL(delay); } }; struct FailOne { static std::string typeName() { return "fail-one"; } - std::optional delay; + std::optional delay; std::optional level; std::optional number; std::optional index; void parse(YAML::Node node) { - SERIALIZE_VAR(delay); + SERIALIZE_NS3_TIME_OPTIONAL(delay); SERIALIZE_VAR(level); SERIALIZE_VAR(number); SERIALIZE_VAR(index); @@ -124,11 +125,11 @@ struct FailOne { struct FailMany { static std::string typeName() { return "fail-many"; } - std::optional delay; + std::optional delay; uint32_t number; void parse(YAML::Node node) { - SERIALIZE_VAR(delay); + SERIALIZE_NS3_TIME_OPTIONAL(delay); SERIALIZE_VAR(number); } }; @@ -136,13 +137,13 @@ struct FailMany { struct MixedExecution { static std::string typeName() { return "mixed-execution"; } - std::optional delay; + std::optional delay; uint32_t join_number; uint32_t leave_number; uint32_t search_number; void parse(YAML::Node node) { - SERIALIZE_VAR(delay); + SERIALIZE_NS3_TIME_OPTIONAL(delay); SERIALIZE_VAR(join_number); SERIALIZE_VAR(leave_number); SERIALIZE_VAR(search_number); @@ -152,9 +153,9 @@ struct MixedExecution { struct ValidateLeave { static std::string typeName() { return "validate-leave"; } - std::optional delay; + std::optional delay; - void parse(YAML::Node node) { SERIALIZE_VAR(delay); } + void parse(YAML::Node node) { SERIALIZE_NS3_TIME_OPTIONAL(delay); } }; struct FindQuery { @@ -178,9 +179,9 @@ struct FindQuery { struct Time { static std::string typeName() { return "time"; } - uint32_t time; + ns3::Time time; - void parse(YAML::Node node) { SERIALIZE_VAR(time); } + void parse(YAML::Node node) { SERIALIZE_NS3_TIME(time); } }; struct StaticBuild { diff --git a/daisi/src/natter-ns3/CMakeLists.txt b/daisi/src/natter-ns3/CMakeLists.txt index 9b530ef3..8e0012af 100644 --- a/daisi/src/natter-ns3/CMakeLists.txt +++ b/daisi/src/natter-ns3/CMakeLists.txt @@ -107,6 +107,7 @@ target_sources(daisi_natter_scenariofile target_link_libraries(daisi_natter_scenariofile PUBLIC daisi_manager_general_scenariofile + ns3::libcore PRIVATE daisi_utils ) diff --git a/daisi/src/natter-ns3/natter_manager.cpp b/daisi/src/natter-ns3/natter_manager.cpp index cff3a58d..0aef2549 100644 --- a/daisi/src/natter-ns3/natter_manager.cpp +++ b/daisi/src/natter-ns3/natter_manager.cpp @@ -211,36 +211,35 @@ void NatterManager::publishRandom(uint32_t message_size) { void NatterManager::joinTopic(int /*number*/) { throw std::runtime_error("Not implemented yet"); } -void NatterManager::scheduleEvent(const Join &step, uint64_t ¤t_time) { - const uint64_t join_delay = scenariofile_.default_delay + step.delay.value_or(0); +void NatterManager::scheduleEvent(const Join &step, ns3::Time ¤t_time) { + const ns3::Time join_delay = scenariofile_.default_delay + step.delay.value_or(ns3::Time(0)); current_time += join_delay; if (step.mode == "minhton") { if (scenariofile_.fanout < 2) throw std::runtime_error("fanout must be >=2 for minhton"); - Simulator::Schedule(MilliSeconds(current_time), &NatterManager::joinMinhton, this); + Simulator::Schedule(current_time, &NatterManager::joinMinhton, this); } else { throw std::invalid_argument("Invalid mode type for join"); } } -void NatterManager::scheduleEvent(const Publish &step, uint64_t ¤t_time) { - const uint64_t publish_delay = scenariofile_.default_delay + step.delay.value_or(0); +void NatterManager::scheduleEvent(const Publish &step, ns3::Time ¤t_time) { + const ns3::Time publish_delay = scenariofile_.default_delay + step.delay.value_or(ns3::Time(0)); for (uint32_t i = 0; i < step.number; i++) { current_time += publish_delay; if (step.mode == "random") - Simulator::Schedule(MilliSeconds(current_time), &NatterManager::publishRandom, this, - step.message_size); + Simulator::Schedule(current_time, &NatterManager::publishRandom, this, step.message_size); else if (step.mode == "sequential") - Simulator::Schedule(MilliSeconds(current_time), &NatterManager::publish, this, - step.message_size, i % getNumberOfNodes()); + Simulator::Schedule(current_time, &NatterManager::publish, this, step.message_size, + i % getNumberOfNodes()); else throw std::runtime_error("Invalid publish mode"); } } void NatterManager::scheduleEvents() { - uint64_t current_time = 0; + ns3::Time current_time = ns3::Time(0); for (const NatterScenarioSequenceStep &step : scenariofile_.scenario_sequence) { std::visit([this, ¤t_time](auto &&step) { scheduleEvent(step, current_time); }, diff --git a/daisi/src/natter-ns3/natter_manager.h b/daisi/src/natter-ns3/natter_manager.h index 8c63fd29..c693533f 100644 --- a/daisi/src/natter-ns3/natter_manager.h +++ b/daisi/src/natter-ns3/natter_manager.h @@ -48,8 +48,8 @@ class NatterManager : public Manager { std::string getDatabaseFilename() override; std::string getAdditionalParameters() override; - void scheduleEvent(const Join &step, uint64_t ¤t_time); - void scheduleEvent(const Publish &step, uint64_t ¤t_time); + void scheduleEvent(const Join &step, ns3::Time ¤t_time); + void scheduleEvent(const Publish &step, ns3::Time ¤t_time); void joinTopic(int number_nodes); void publishRandom(uint32_t message_size); diff --git a/daisi/src/natter-ns3/natter_scenariofile.cpp b/daisi/src/natter-ns3/natter_scenariofile.cpp index 860ca93e..98bf6f17 100644 --- a/daisi/src/natter-ns3/natter_scenariofile.cpp +++ b/daisi/src/natter-ns3/natter_scenariofile.cpp @@ -22,13 +22,13 @@ namespace daisi::natter_ns3 { void Join::parse(YAML::Node node) { SERIALIZE_VAR(mode); - SERIALIZE_VAR(delay); + SERIALIZE_NS3_TIME_OPTIONAL(delay); } void Publish::parse(YAML::Node node) { SERIALIZE_VAR(mode); SERIALIZE_VAR(number); - SERIALIZE_VAR(delay); + SERIALIZE_NS3_TIME_OPTIONAL(delay); SERIALIZE_VAR(message_size); } diff --git a/daisi/src/natter-ns3/natter_scenariofile.h b/daisi/src/natter-ns3/natter_scenariofile.h index cda148f5..b1962185 100644 --- a/daisi/src/natter-ns3/natter_scenariofile.h +++ b/daisi/src/natter-ns3/natter_scenariofile.h @@ -21,6 +21,7 @@ #include #include "manager/general_scenariofile.h" +#include "ns3/core-module.h" namespace daisi::natter_ns3 { @@ -28,7 +29,7 @@ struct Join { static std::string typeName() { return "join"; } std::string mode; - std::optional delay = 0; + std::optional delay; void parse(YAML::Node node); }; @@ -38,7 +39,7 @@ struct Publish { std::string mode; uint64_t number = 0; - std::optional delay = 0; + std::optional delay; uint64_t message_size = 0; void parse(YAML::Node node); diff --git a/daisi/src/sola-ns3/CMakeLists.txt b/daisi/src/sola-ns3/CMakeLists.txt index e08129ea..3949f859 100644 --- a/daisi/src/sola-ns3/CMakeLists.txt +++ b/daisi/src/sola-ns3/CMakeLists.txt @@ -125,6 +125,7 @@ target_sources(daisi_sola_scenariofile target_link_libraries(daisi_sola_scenariofile PUBLIC daisi_manager_general_scenariofile + ns3::libcore PRIVATE daisi_utils ) diff --git a/daisi/src/sola-ns3/sola_manager.cpp b/daisi/src/sola-ns3/sola_manager.cpp index ddcbef6f..167a408c 100644 --- a/daisi/src/sola-ns3/sola_manager.cpp +++ b/daisi/src/sola-ns3/sola_manager.cpp @@ -55,7 +55,7 @@ ns3::Ptr SolaManager::getApplication(uint32_t id) const { } void SolaManager::scheduleEvents() { - uint64_t current_time = 0; + ns3::Time current_time = ns3::Time(0); for (const SolaScenarioSequenceStep &step : scenariofile_.scenario_sequence) { std::visit([this, ¤t_time](auto &&step) { schedule(step, current_time); }, step.step); diff --git a/daisi/src/sola-ns3/sola_manager.h b/daisi/src/sola-ns3/sola_manager.h index 441e1dd9..d108d700 100644 --- a/daisi/src/sola-ns3/sola_manager.h +++ b/daisi/src/sola-ns3/sola_manager.h @@ -52,10 +52,10 @@ class SolaManager : public Manager { std::vector>>>::iterator; // Scheduling methods, implemented in sola_manager_scheduler.cpp - void schedule(StartSOLA start, uint64_t ¤t_time); - void schedule(SubscribeTopic subscribe, uint64_t ¤t_time); - void schedule(Delay delay, uint64_t ¤t_time); - void schedule(Publish publish, uint64_t ¤t_time); + void schedule(StartSOLA start, ns3::Time ¤t_time); + void schedule(SubscribeTopic subscribe, ns3::Time ¤t_time); + void schedule(Delay delay, ns3::Time ¤t_time); + void schedule(Publish publish, ns3::Time ¤t_time); ns3::Ptr getApplication(uint32_t id) const; diff --git a/daisi/src/sola-ns3/sola_manager_scheduler.cpp b/daisi/src/sola-ns3/sola_manager_scheduler.cpp index d78a9b9d..afaea6f5 100644 --- a/daisi/src/sola-ns3/sola_manager_scheduler.cpp +++ b/daisi/src/sola-ns3/sola_manager_scheduler.cpp @@ -19,37 +19,35 @@ #define GET_VALUE(type, name) INNER_TABLE(it)->getRequired(name); namespace daisi::sola_ns3 { -void SolaManager::schedule(StartSOLA start, uint64_t ¤t_time) { - const uint64_t delay = start.delay; +void SolaManager::schedule(StartSOLA start, ns3::Time ¤t_time) { + const ns3::Time delay = start.delay; for (uint32_t i = 0; i < scenariofile_.number_nodes; i++) { - ns3::Simulator::ScheduleWithContext(node_container_.Get(i)->GetId(), - ns3::MilliSeconds(current_time), &SolaManager::startSOLA, - this, i); + ns3::Simulator::ScheduleWithContext(node_container_.Get(i)->GetId(), current_time, + &SolaManager::startSOLA, this, i); current_time += delay; } current_time -= delay; // No delay at end (should be default delay) } -void SolaManager::schedule(SubscribeTopic subscribe, uint64_t ¤t_time) { - const uint64_t delay = subscribe.delay; +void SolaManager::schedule(SubscribeTopic subscribe, ns3::Time ¤t_time) { + const ns3::Time delay = subscribe.delay; for (uint32_t i = 0; i < scenariofile_.number_nodes; i++) { - ns3::Simulator::ScheduleWithContext(node_container_.Get(i)->GetId(), - ns3::MilliSeconds(current_time), + ns3::Simulator::ScheduleWithContext(node_container_.Get(i)->GetId(), current_time, &SolaManager::subscribeTopic, this, subscribe.topic, i); current_time += delay; } current_time -= delay; // No delay at end (should be default delay) } -void SolaManager::schedule(Delay delay, uint64_t ¤t_time) { current_time += delay.delay; } +void SolaManager::schedule(Delay delay, ns3::Time ¤t_time) { current_time += delay.delay; } -void SolaManager::schedule(Publish publish, uint64_t ¤t_time) { +void SolaManager::schedule(Publish publish, ns3::Time ¤t_time) { const uint32_t node_id = publish.node_id; - ns3::Simulator::ScheduleWithContext(node_container_.Get(node_id)->GetId(), - ns3::MilliSeconds(current_time), &SolaManager::publishTopic, - this, node_id, publish.topic, publish.message_size); + ns3::Simulator::ScheduleWithContext(node_container_.Get(node_id)->GetId(), current_time, + &SolaManager::publishTopic, this, node_id, publish.topic, + publish.message_size); } } // namespace daisi::sola_ns3 diff --git a/daisi/src/sola-ns3/sola_scenariofile.cpp b/daisi/src/sola-ns3/sola_scenariofile.cpp index fb2916cb..163159ba 100644 --- a/daisi/src/sola-ns3/sola_scenariofile.cpp +++ b/daisi/src/sola-ns3/sola_scenariofile.cpp @@ -20,14 +20,14 @@ namespace daisi::sola_ns3 { -void StartSOLA::parse(YAML::Node node) { SERIALIZE_VAR(delay); } +void StartSOLA::parse(YAML::Node node) { SERIALIZE_NS3_TIME(delay); } void SubscribeTopic::parse(YAML::Node node) { SERIALIZE_VAR(topic); - SERIALIZE_VAR(delay); + SERIALIZE_NS3_TIME(delay); } -void Delay::parse(YAML::Node node) { SERIALIZE_VAR(delay); } +void Delay::parse(YAML::Node node) { SERIALIZE_NS3_TIME(delay); } void Publish::parse(YAML::Node node) { SERIALIZE_VAR(topic); diff --git a/daisi/src/sola-ns3/sola_scenariofile.h b/daisi/src/sola-ns3/sola_scenariofile.h index c5538a83..29a8f8d6 100644 --- a/daisi/src/sola-ns3/sola_scenariofile.h +++ b/daisi/src/sola-ns3/sola_scenariofile.h @@ -21,13 +21,14 @@ #include #include "manager/general_scenariofile.h" +#include "ns3/core-module.h" namespace daisi::sola_ns3 { struct StartSOLA { static std::string typeName() { return "start_sola"; } - uint64_t delay; + ns3::Time delay; void parse(YAML::Node node); }; @@ -36,7 +37,7 @@ struct SubscribeTopic { static std::string typeName() { return "subscribe_topic"; } std::string topic; - uint64_t delay; + ns3::Time delay; void parse(YAML::Node node); }; @@ -44,7 +45,7 @@ struct SubscribeTopic { struct Delay { static std::string typeName() { return "delay"; } - uint64_t delay; + ns3::Time delay; void parse(YAML::Node node); }; diff --git a/daisi/utils/ci_scenario_files/cpps_test.yml b/daisi/utils/ci_scenario_files/cpps_test.yml index 7eec6633..2940f776 100644 --- a/daisi/utils/ci_scenario_files/cpps_test.yml +++ b/daisi/utils/ci_scenario_files/cpps_test.yml @@ -1,8 +1,8 @@ title: CPPS Default Scenario version: 0.1 -stop_time: 5000 +stop_time: 5000s random_seed: 42 -default_delay: 5 +default_delay: 5s # outdated/unused fields # only present until Manager switches to new scenariofile parser as well @@ -104,35 +104,35 @@ scenario_sequence: - amr: entity: amr friendly_name: FPckg - start_time: 0 + start_time: 0s spawn_distribution: type: absolute number: 3 - amr: entity: amr friendly_name: SPckg - start_time: 0 + start_time: 0s spawn_distribution: type: absolute number: 3 - amr: entity: amr friendly_name: WEuro - start_time: 0 + start_time: 0s spawn_distribution: type: absolute number: 3 - amr: entity: amr friendly_name: SEuro - start_time: 0 + start_time: 0s spawn_distribution: type: absolute number: 3 - mf: entity: mf friendly_name: mf1 - start_time: 0 + start_time: 0s spawn_distribution: type: gaussian mean: 100 diff --git a/daisi/utils/ci_scenario_files/minhcast_test.yml b/daisi/utils/ci_scenario_files/minhcast_test.yml index c854db51..098925fd 100644 --- a/daisi/utils/ci_scenario_files/minhcast_test.yml +++ b/daisi/utils/ci_scenario_files/minhcast_test.yml @@ -1,8 +1,8 @@ title: Test version: 0.1 -stop_time: 5000 +stop_time: 5000s random_seed: 1 -default_delay: 500 +default_delay: 0.5s # outdated/unused fields # only present until Manager switches to new scenariofile parser as well @@ -18,6 +18,6 @@ scenario_sequence: mode: minhton - type: publish number: 50 - delay: 0 + delay: 0s mode: sequential # random, sequential message_size: 100 # in bytes diff --git a/daisi/utils/ci_scenario_files/minhton_cases.yml b/daisi/utils/ci_scenario_files/minhton_cases.yml index 0a87ffaa..f3912cbd 100644 --- a/daisi/utils/ci_scenario_files/minhton_cases.yml +++ b/daisi/utils/ci_scenario_files/minhton_cases.yml @@ -1,8 +1,8 @@ title: MINHTON scenario including all join algorithm subcases version: 0.1 -stop_time: 10000000 +stop_time: 10000s random_seed: 1 -default_delay: 5000 +default_delay: 5s # outdated/unused fields # only present until Manager switches to new scenariofile parser as well diff --git a/daisi/utils/ci_scenario_files/minhton_test.yml b/daisi/utils/ci_scenario_files/minhton_test.yml index 8a863f98..acb527c2 100644 --- a/daisi/utils/ci_scenario_files/minhton_test.yml +++ b/daisi/utils/ci_scenario_files/minhton_test.yml @@ -1,8 +1,8 @@ title: MINHTON default scenario version: 0.1 -stop_time: 10000000 +stop_time: 10000s random_seed: 1 -default_delay: 5000 +default_delay: 5s # outdated/unused fields # only present until Manager switches to new scenariofile parser as well diff --git a/daisi/utils/ci_scenario_files/round_robin_test.yml b/daisi/utils/ci_scenario_files/round_robin_test.yml index 7a9b8a8a..611097b5 100644 --- a/daisi/utils/ci_scenario_files/round_robin_test.yml +++ b/daisi/utils/ci_scenario_files/round_robin_test.yml @@ -1,8 +1,8 @@ title: CPPS Round Robin Scenario version: 0.1 -stop_time: 5000 +stop_time: 5000s random_seed: 42 -default_delay: 5 +default_delay: 5s # outdated/unused fields # only present until Manager switches to new scenariofile parser as well @@ -104,35 +104,35 @@ scenario_sequence: - amr: entity: amr friendly_name: FPckg - start_time: 0 + start_time: 0s spawn_distribution: type: absolute number: 3 - amr: entity: amr friendly_name: SPckg - start_time: 0 + start_time: 0s spawn_distribution: type: absolute number: 3 - amr: entity: amr friendly_name: WEuro - start_time: 0 + start_time: 0s spawn_distribution: type: absolute number: 3 - amr: entity: amr friendly_name: SEuro - start_time: 0 + start_time: 0s spawn_distribution: type: absolute number: 3 - mf: entity: mf friendly_name: mf1 - start_time: 0 + start_time: 0s spawn_distribution: type: gaussian mean: 100 diff --git a/docs/daisi/minhton-ns3/scenariofile.md b/docs/daisi/minhton-ns3/scenariofile.md index 2a81a439..9c23c672 100644 --- a/docs/daisi/minhton-ns3/scenariofile.md +++ b/docs/daisi/minhton-ns3/scenariofile.md @@ -227,7 +227,8 @@ When ``level`` + ``number`` and ``index`` are both defined, ``level`` + ``number - ``delay`` - Required: - - Data type: ``uint32_t`` + - Data type: ``std::string`` + - Possible values: Any string ending with a unit prefix like "s" or "ms". If no unit is given, it will be treated as seconds. - ``level`` - Required: :fontawesome-solid-star-of-life: (Together with ``number``. Alternatively define the ``index``.) - Data type: ``uint32_t`` @@ -247,7 +248,8 @@ Depending on the ``mode``, the new nodes either join on a node randomly selected - ``delay`` - Required: - - Data type: ``uint32_t`` + - Data type: ``std::string`` + - Possible values: Any string ending with a unit prefix like "s" or "ms". If no unit is given, it will be treated as seconds. - ``number`` - Required: :fontawesome-solid-star-of-life: - Data type: ``uint32_t`` @@ -265,7 +267,8 @@ When ``level`` + ``number`` and ``index`` are defined, ``level`` + ``number`` ta - ``delay`` - Required: - - Data type: ``uint32_t`` + - Data type: ``std::string`` + - Possible values: Any string ending with a unit prefix like "s" or "ms". If no unit is given, it will be treated as seconds. - ``level`` - Required: :fontawesome-solid-star-of-life: (Together with ``number``. Alternatively define the ``index``.) - Data type: ``uint32_t`` @@ -285,7 +288,8 @@ Depending on the ``mode``, the nodes are either randomly selected each time, or - ``delay`` - Required: - - Data type: ``uint32_t`` + - Data type: ``std::string`` + - Possible values: Any string ending with a unit prefix like "s" or "ms". If no unit is given, it will be treated as seconds. - ``number`` - Required: :fontawesome-solid-star-of-life: - Data type: ``uint32_t`` @@ -302,7 +306,8 @@ Searches for multiple nodes (with the amount given by `number`). - ``delay`` - Required: - - Data type: ``uint32_t`` + - Data type: ``std::string`` + - Possible values: Any string ending with a unit prefix like "s" or "ms". If no unit is given, it will be treated as seconds. - ``number`` - Required: :fontawesome-solid-star-of-life: - Data type: ``uint32_t`` @@ -316,7 +321,8 @@ Warning: Can quickly congest the network! - ``delay`` - Required: - - Data type: ``uint32_t`` + - Data type: ``std::string`` + - Possible values: Any string ending with a unit prefix like "s" or "ms". If no unit is given, it will be treated as seconds. #### `scenario_sequence.fail-one` @@ -327,7 +333,8 @@ When ``level`` + ``number`` and ``index`` are defined, ``level`` + ``number`` ta - ``delay`` - Required: - - Data type: ``uint32_t`` + - Data type: ``std::string`` + - Possible values: Any string ending with a unit prefix like "s" or "ms". If no unit is given, it will be treated as seconds. - ``level`` - Required: :fontawesome-solid-star-of-life: (Together with ``number``. Alternatively define the ``index``.) - Data type: ``uint32_t`` @@ -346,7 +353,8 @@ Initiates a failure on multiple nodes (with the amount given by `number`). - ``delay`` - Required: - - Data type: ``uint32_t`` + - Data type: ``std::string`` + - Possible values: Any string ending with a unit prefix like "s" or "ms". If no unit is given, it will be treated as seconds. - ``number`` - Required: :fontawesome-solid-star-of-life: - Data type: ``uint32_t`` @@ -359,7 +367,8 @@ Schedules a mixed execution with joins (with the amount given by ``join-number`` - ``delay`` - Required: - - Data type: ``uint32_t`` + - Data type: ``std::string`` + - Possible values: Any string ending with a unit prefix like "s" or "ms". If no unit is given, it will be treated as seconds. - ``join-number`` - Required: :fontawesome-solid-star-of-life: - Data type: ``uint32_t`` @@ -378,7 +387,8 @@ Iterates over all nodes and lets them leave, followed by them joining the networ - ``delay`` - Required: - - Data type: ``uint32_t`` + - Data type: ``std::string`` + - Possible values: Any string ending with a unit prefix like "s" or "ms". If no unit is given, it will be treated as seconds. #### `scenario_sequence.find-query` @@ -405,13 +415,14 @@ The find query is specified by ``scope``, ``query``, and ``validity-threshold``. #### `scenario_sequence.time` -Waits the specificed amount of ``time`` (miliseconds). +Waits the specificed amount of ``time``. ??? properties - ``time`` - Required: :fontawesome-solid-star-of-life: - - Data type: ``uint32_t`` + - Data type: ``std::string`` + - Possible values: Any string ending with a unit prefix like "s" or "ms". If no unit is given, it will be treated as seconds. #### `scenario_sequence.static-build` @@ -443,7 +454,7 @@ scenario_sequence: - type: join-many: number: 100 mode: random - delay: 1000 + delay: 1s ``` ### Removing Nodes @@ -455,11 +466,11 @@ scenario_sequence: - type: join-many: number: 100 mode: random - delay: 1000 + delay: 1s - type: leave-many: number: 100 mode: random - delay: 1000 + delay: 1s ``` ### Searching Nodes @@ -472,12 +483,12 @@ scenario_sequence: - type: join-many: number: 100 mode: random - delay: 1000 + delay: 1s - type: search-many: number: 100 - delay: 1000 + delay: 1s - type: search-all: - delay: 1000 + delay: 1s ``` ### Static P2P Build @@ -493,7 +504,7 @@ scenario_sequence: - type: static-build: number: 100 mode: random - delay: 1000 + delay: 1s ``` ### Peer Discovery diff --git a/docs/daisi/natter-ns3/scenariofile.md b/docs/daisi/natter-ns3/scenariofile.md index b1644eef..7a1c87b5 100644 --- a/docs/daisi/natter-ns3/scenariofile.md +++ b/docs/daisi/natter-ns3/scenariofile.md @@ -168,8 +168,8 @@ Specifies **additional** delay (added to ``default_delay``) that is added **befo ??? properties - Required: - - Reasonable default: `5000` - - Data type: ``uint64_t`` + - Data type: ``std::string`` + - Possible values: Any string ending with a unit prefix like "s" or "ms". If no unit is given, it will be treated as seconds. #### ``scenario_sequence.publish`` @@ -201,8 +201,8 @@ When more than one node should publish a message in the same step, this delay is ??? properties - Required: - - Reasonable default: `5000` - - Data type: ``uint64_t`` + - Data type: ``std::string`` + - Possible values: Any string ending with a unit prefix like "s" or "ms". If no unit is given, it will be treated as seconds. #### ``scenario_sequence.publish.mode`` diff --git a/docs/daisi/optimaflow-ns3/scenariofile.md b/docs/daisi/optimaflow-ns3/scenariofile.md index 6dfd8370..c2e940a3 100644 --- a/docs/daisi/optimaflow-ns3/scenariofile.md +++ b/docs/daisi/optimaflow-ns3/scenariofile.md @@ -341,7 +341,8 @@ The specific typ of the entity to initialize (for example the friendly name of a ??? properties - Required: :fontawesome-solid-star-of-life: - - Data type: ``uint64_t`` + - Data type: ``std::string`` + - Possible values: Any string ending with a unit prefix like "s" or "ms". If no unit is given, it will be treated as seconds. #### ``scenario_sequence.spawnInfo.spawn_distribution`` diff --git a/docs/daisi/sola-ns3/scenariofile.md b/docs/daisi/sola-ns3/scenariofile.md index 39cd5340..a4db4fbf 100644 --- a/docs/daisi/sola-ns3/scenariofile.md +++ b/docs/daisi/sola-ns3/scenariofile.md @@ -140,8 +140,8 @@ Delay between the nodes joining the SOLA network. ??? properties - Required: :fontawesome-solid-star-of-life: - - Reasonable default: `1000` - - Data type: ``uint64_t`` + - Data type: ``std::string`` + - Possible values: Any string ending with a unit prefix like "s" or "ms". If no unit is given, it will be treated as seconds. #### ``scenario_sequence.subscribe_topic`` @@ -177,8 +177,8 @@ Delay between the nodes joining the SOLA network. ??? properties - Required: :fontawesome-solid-star-of-life: - - Reasonable default: `1000` - - Data type: ``uint64_t`` + - Data type: ``std::string`` + - Possible values: Any string ending with a unit prefix like "s" or "ms". If no unit is given, it will be treated as seconds. #### ``scenario_sequence.delay`` @@ -193,12 +193,13 @@ This is a dictionary containing key, value pairs, that further specify this step #### ``scenario_sequence.delay.delay`` -The delay in miliseconds. +The delay. ??? properties - Required: :fontawesome-solid-star-of-life: - - Data type: ``uint64_t`` + - Data type: ``std::string`` + - Possible values: Any string ending with a unit prefix like "s" or "ms". If no unit is given, it will be treated as seconds. #### ``scenario_sequence.publish``