@@ -195,7 +195,7 @@ namespace marxan {
195
195
//
196
196
void hill_climbing_two_steps (int puno, int spno, const vector<spustuff>& pu, const vector<sconnections>& connections,
197
197
vector<sspecies>& spec, const vector<spu>& SM, vector<spu_out>& SM_out, vector<int >& R, double cm,
198
- scost& reserve, scost& change, double costthresh, double tpf1, double tpf2,
198
+ scost& reserve, double costthresh, double tpf1, double tpf2,
199
199
int clumptype, int irun, int iterations, string savename, stringstream& logBuffer, rng_engine& rngEngine)
200
200
{
201
201
int puvalid = 0 , ipu = 0 ;
@@ -241,18 +241,18 @@ namespace marxan {
241
241
242
242
for (int i0 = 0 ; i0 < puvalid && itime <= iterations; i0++)
243
243
{
244
- scost change0;
244
+ scost change0 = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
245
245
int ichoice0 = iimparray[i0];
246
246
// remenber old score
247
247
int imode0 = R[ichoice0] == 1 ? -1 : 1 ;
248
248
computeChangeScore (-1 , ichoice0, spno, puno, pu, connections, spec, SM, SM_out, R, cm, imode0, change0, reserve,
249
249
costthresh, tpf1, tpf2, 1 , clumptype);
250
250
251
- doChange (ichoice0, puno, R, reserve, change , pu, SM, SM_out, spec, connections, imode0, clumptype, logBuffer);
251
+ doChange (ichoice0, puno, R, reserve, change0 , pu, SM, SM_out, spec, connections, imode0, clumptype, logBuffer);
252
252
253
253
for (int i1 = i0+1 ; i1 < puvalid && itime <= iterations; i1++, itime++)
254
254
{
255
- scost change1;
255
+ scost change1 = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
256
256
int ichoice1 = iimparray[i1];
257
257
258
258
int imode1 = R[ichoice1] == 1 ? -1 : 1 ;
@@ -266,7 +266,7 @@ namespace marxan {
266
266
}
267
267
268
268
if (fnames.saveitimptrace )
269
- import_trace_saver.append ( itime, puno, reserve, change , R);
269
+ import_trace_saver.append ( itime, puno, reserve, change1 , R);
270
270
271
271
} // no untested PUs left
272
272
if (!was_change)
0 commit comments