File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -71,19 +71,23 @@ argos::CColor ForagingTwoSpotsLoopFunction::GetFloorColor(const argos::CVector2&
71
71
/* ***************************************/
72
72
73
73
void ForagingTwoSpotsLoopFunction::Reset () {
74
- m_unNumberRobots = 70 ;
74
+ // m_unNumberRobots = 70;
75
+ CoreLoopFunctions::Reset ();
75
76
m_fObjectiveFunction = 0 ;
76
- for (UInt32 i = 0 ; i <= m_unNumberRobots; i++) {
77
- m_punFoodData[i] = 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 ];
78
83
}
79
- CoreLoopFunctions::Reset ();
80
84
}
81
85
82
86
/* ***************************************/
83
87
/* ***************************************/
84
88
85
89
void ForagingTwoSpotsLoopFunction::PostStep () {
86
- m_unNumberRobots = m_unNumberRobots ;
90
+ // m_unNumberRobots = 70 ;
87
91
if (m_bInitializationStep) {
88
92
m_punFoodData = new UInt32[m_unNumberRobots+1 ];
89
93
for (UInt32 i = 0 ; i <= m_unNumberRobots; i++) {
You can’t perform that action at this time.
0 commit comments