Skip to content

Commit 558653b

Browse files
committed
Solving conflicts
2 parents 03180d2 + 5b77653 commit 558653b

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

loop-functions/complexity/AggregationSingleSpot.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ void AggregationSingleSpot::Reset() {
6464
CoreLoopFunctions::Reset();
6565
}
6666

67+
6768
/****************************************/
6869
/****************************************/
6970

loop-functions/complexity/AggregationSingleSpot.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <argos3/plugins/robots/e-puck/simulator/epuck_entity.h>
1515

1616
#include "../../src/CoreLoopFunctions.h"
17+
//#include "/home/aligot/Desktop/Arena/NEAT-private/src/controllers/NeuralNetworkRM1Dot2Binary.h"
1718

1819
using namespace argos;
1920

loop-functions/vanilla/ForagingTwoSpotsLoopFunc.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,13 @@ void ForagingTwoSpotsLoopFunction::PostStep() {
104104
UInt32 unId;
105105
for (CSpace::TMapPerType::iterator it = tEpuckMap.begin(); it != tEpuckMap.end(); ++it) {
106106
CEPuckEntity* pcEpuck = any_cast<CEPuckEntity*>(it->second);
107-
unId = atoi(pcEpuck->GetId().substr(5, 2).c_str());
107+
// unId = atoi(pcEpuck->GetId().substr(5, 2).c_str());
108+
// expects the id to be in the following form: epuck_{unId}_{robotId}
109+
std::string robot_id = pcEpuck->GetId();
110+
UInt8 first_underscore = robot_id.find("_");
111+
UInt8 second_underscore = robot_id.find("_", first_underscore+1);
112+
robot_id = robot_id.substr(first_underscore, second_underscore-first_underscore);
113+
unId = atoi(robot_id.c_str());
108114
cEpuckPosition.Set(pcEpuck->GetEmbodiedEntity().GetOriginAnchor().Position.GetX(),
109115
pcEpuck->GetEmbodiedEntity().GetOriginAnchor().Position.GetY());
110116

@@ -117,8 +123,10 @@ void ForagingTwoSpotsLoopFunction::PostStep() {
117123
} else if (cEpuckPosition.GetY() <= m_fNestLimit) {
118124
m_fObjectiveFunction = m_fObjectiveFunction + m_punFoodData[unId];
119125
m_punFoodData[unId] = 0;
126+
// LOG << "Obj " << m_fObjectiveFunction << std::endl;
120127
}
121128
}
129+
122130
if (score_temp != m_fObjectiveFunction) {
123131
LOGERR << "Obj " << m_fObjectiveFunction << std::endl;
124132
}

0 commit comments

Comments
 (0)