Commit aa469a58 authored by Sonja Happ's avatar Sonja Happ

move a sync of el. connections to FBS method, move starting of tick time...

move a sync of el. connections to FBS method, move starting of tick time measurements to agent messages method
parent 10d1e755
......@@ -1359,14 +1359,13 @@ void Model::set_MR_input(){
void Model::initSchedule(repast::ScheduleRunner& runner){
//start measurement of exact tick duration (stop is called in Model::step(...) method)
runner.scheduleEvent(0.4, 1, repast::Schedule::FunctorPtr(new repast::MethodFunctor<Model> (this, &Model::start_tick_time_measurement)));
//runner.scheduleEvent(0.4, 1, repast::Schedule::FunctorPtr(new repast::MethodFunctor<Model> (this, &Model::start_tick_time_measurement)));
//calculate communication interactions and agent intelligence
//RepastHPC copy and update of Message Routers is invoked at beginning of this method
//calculate communication interactions and agent behavior
runner.scheduleEvent(0.6, 1, repast::Schedule::FunctorPtr(new repast::MethodFunctor<Model> (this, &Model::process_agent_messages)));
//synchronize electrical connections
runner.scheduleEvent(0.7, 1, repast::Schedule::FunctorPtr(new repast::MethodFunctor<Model> (this, &Model::synchronize_el_connections)));
//synchronize electrical connections (required to sync next_action expected and convergence flags of non-local agents)
//runner.scheduleEvent(0.7, 1, repast::Schedule::FunctorPtr(new repast::MethodFunctor<Model> (this, &Model::synchronize_el_connections)));
//calculate electrical interactions
runner.scheduleEvent(0.8, 1, repast::Schedule::FunctorPtr(new repast::MethodFunctor<Model> (this, &Model::forward_backward_sweep)));
......@@ -1381,11 +1380,11 @@ void Model::initSchedule(repast::ScheduleRunner& runner){
/*#################### METHODS USED DURING EXECUTION OF THE MODEL ##########################*/
void Model::start_tick_time_measurement() {
/*void Model::start_tick_time_measurement() {
IO->start_time_measurement(IO->tm_rt_tick);
IO->start_time_measurement(IO->tm_tick);
}
}*/
/*! \brief Synchronize copies of non-local agents with their origins using RepastHPC methods
* \param agent_set Name of the set of non-local agents to be updated
......@@ -1498,6 +1497,11 @@ void Model::step() {
* As a result, the agents determine their control behavior
* */
void Model::process_agent_messages() {
//start tick time measurements (stopped in step method of the same tick)
IO->start_time_measurement(IO->tm_rt_tick);
IO->start_time_measurement(IO->tm_tick);
IO->start_time_measurement(IO->tm_msg_proc_internal);
IO->log_info("####### now calculating communication interactions #######");
......
......@@ -11,6 +11,10 @@ void Model::forward_backward_sweep() {
IO->start_time_measurement(IO->tm_fb_sweep);
// synchronize electrical connections
// required to sync (=reset) next_action_expected and convergence flags of non-local agents
synchronize_el_connections();
repast::ScheduleRunner &runner = repast::RepastProcess::instance()->getScheduleRunner();
IO->reset_number_of_fbs_sweeps();
IO->reset_loop_counters();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment