Beispiel #1
0
    def step():
        global time
        for intervention in interventions:
            if time >= intervention.time:
                intervention.apply(eutopia, time)
        time += 1

        eutopia.step()
Beispiel #2
0
    def step():
        global time
        for intervention in interventions:
            if time >= intervention.time:
                intervention.apply(eutopia, time)
        time += 1

        eutopia.step()
Beispiel #3
0
    def __next__(self):
        # apply interventions
        for intervention in self.interventions:
            if self.time >= intervention.time:
                intervention.apply(self, self.time)

        # run model
        self.latest_activity_count = self.get_activity_count()
        for family in self.families:
            family.step()
        self.time += 1

        # log metrics
        if self.log is not None:
            self.log.append((self.time, self.get_activity_count())) #XXX assumes a list (or a list-like object)
Beispiel #4
0
    def __next__(self):
        # apply interventions
        for intervention in self.interventions:
            if self.time >= intervention.time:
                intervention.apply(self, self.time)

        # run model
        self.latest_activity_count = self.get_activity_count()
        for family in self.families:
            family.step()
        self.time += 1

        # log metrics
        if self.log is not None:
            self.log.append((self.time, self.get_activity_count()
                             ))  #XXX assumes a list (or a list-like object)