Commit c2b896b8 authored by Dumoulin Nicolas's avatar Dumoulin Nicolas
Browse files

Only scenarios of last iteration used.

parent 21c7d512
......@@ -65,8 +65,8 @@ class ScenariosStack:
return id
def retain(self, mask):
self.cultgeopat = self.cultgeopat[mask]
self.scores = self.scores[mask]
self.cultgeopat = self.cultgeopat[mask | (self.scores['full_reallocated'])]
self.scores = self.scores[mask | (self.scores['full_reallocated'])]
def setFullReallocated(self, id_scen, full_reallocated):
self.scores.loc[id_scen,'full_reallocated'] = full_reallocated
......@@ -80,8 +80,8 @@ class ScenariosStack:
def allFullReallocated(self):
return self.scores[self.scores['full_reallocated']==False].empty
def sample(self, nb, rng):
return self.cultgeopat[self.scores['full_reallocated']==False].sample(nb, replace=True, random_state=rng)
def sample(self, nb, rng, mask=True):
return self.cultgeopat[mask & (self.scores['full_reallocated']==False)].sample(nb, replace=True, random_state=rng)
def consolidate_scenario(self, id, columns):
selected_data = self.initial_patches[columns]
......
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