Skip to content

Simplification: Remove model.running #1230

@rht

Description

@rht

In most cases, models are run with explicit, N number of steps. In case where it has a halting condition, it is easy to override model.run_model like this. E.g. for forest fire
before

    def step(self):
        ...
        # Halt if no more fire
        if self.count_type(self, "On Fire") == 0:
            self.running = False

    def run_model(self):
        while self.running:
            self.step()

after

    def run_model(self):
        while True:
            self.step()
            if self.count_type(self, "On Fire") == 0:
                break

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions