Commit 66a7665b authored by Sonja Happ's avatar Sonja Happ

introduce OR case for evenly agent distribution so that simulation does not get stuck

parent 3ca54b38
......@@ -151,7 +151,7 @@ void Model::do_forward_sweep() {
if(!started_convergence_check) {
//perform forward sweep for all node agents
for (unsigned long i = agents_scheduling.size(); i > 0; i--) { // iterate backwards...
if(state[i-1] == DONE_NOTHING){
if(state[i-1] == DONE_NOTHING || distribution_method == "evenly" ){
state[i-1] = agents_scheduling[i-1]->do_forward_sweep(agent_network_elec);
IO->log_info("FW ID " + std::to_string(agents_scheduling[i-1]->getId().id()) + " state=" + std::to_string(state[i-1]));
if (state[i-1] == DONE_CONVERGENCE_CHECK){
......@@ -166,7 +166,7 @@ void Model::do_forward_sweep() {
//perform convergence check for all node agents
int index = 0;
for (auto i : agents_scheduling) { // iterate forward...
if(state[index] == DONE_FORWARD_SWEEP){
if(state[index] == DONE_FORWARD_SWEEP || distribution_method == "evenly" ){
state[index] = i->do_forward_sweep(agent_network_elec);
IO->log_info("Conv. ID " + std::to_string(i->getId().id()) + " state="+ std::to_string(state[index]));
if(state[index] == DONE_CONVERGENCE_CHECK){
......
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