File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -71,16 +71,13 @@ argos::CColor ForagingTwoSpotsLoopFunction::GetFloorColor(const argos::CVector2&
71
71
/* ***************************************/
72
72
73
73
void ForagingTwoSpotsLoopFunction::Reset () {
74
- // m_unNumberRobots = 70;
75
- CoreLoopFunctions::Reset ();
74
+ std::ios::sync_with_stdio (false );
76
75
m_fObjectiveFunction = 0 ;
77
- if (m_punFoodData != NULL ) {
78
- for (UInt32 i = 0 ; i <= m_unNumberRobots; i++) {
79
- m_punFoodData[i] = 0 ;
80
- }
81
- } else {
82
- m_punFoodData = new UInt32[m_unNumberRobots+1 ];
76
+ m_punFoodData = new UInt32[m_unNumberRobots+1 ];
77
+ for (UInt32 i = m_unNumberRobots; i <= m_unNumberRobots; i++) {
78
+ m_punFoodData[i] = 0 ;
83
79
}
80
+ m_bInitializationStep = true ;
84
81
}
85
82
86
83
/* ***************************************/
@@ -110,7 +107,7 @@ void ForagingTwoSpotsLoopFunction::PostStep() {
110
107
m_punFoodData[unId] = 1 ;
111
108
} else if (fDistanceSpot2 <= m_fRadius){
112
109
m_punFoodData[unId] = 1 ;
113
- } else if (cEpuckPosition.GetY () > = m_fNestLimit) {
110
+ } else if (cEpuckPosition.GetY () < = m_fNestLimit) {
114
111
m_fObjectiveFunction = m_fObjectiveFunction + m_punFoodData[unId];
115
112
m_punFoodData[unId] = 0 ;
116
113
}
You can’t perform that action at this time.
0 commit comments