bim2sim.tasks package

Package containing classes for high level tasks

Subpackages

Submodules

bim2sim.tasks.base module

Module containing the ITask base class an Playground to execute ITasks.

All Tasks should inherit from ITask

class bim2sim.tasks.base.ITask(playground)

Bases: object

Baseclass for interactive Tasks.

Args:
reads: names of the arguments the run() method requires. The arguments

are outputs from previous tasks

touches: names that are assigned to the return value tuple of method

run()

final: flag that indicates termination of project run after this tasks single_user: flag that indicates if this tasks can be run multiple times

in same Playground

final = False
reads: Tuple[str] = ()
classmethod requirements_met(state, history) bool

Check if all requirements for this tasks are met.

Args:

state: state of playground history: history of playground

run(**kwargs)

Run tasks.

single_use = True
touches: Tuple[str] = ()
class bim2sim.tasks.base.Playground(project: Project)

Bases: object

Playground for executing ITasks

static all_tasks() List[Type[ITask]]

Returns list of all tasks

available_tasks() List[Type[ITask]]

Returns list of available tasks

run_task(task: ITask) Generator[DecisionBunch, None, None]

Generator executing tasks with arguments specified in tasks.reads.

update_elements(elements)

Updates the elements of the current run.

This only has to be done if you want to update elements manually, if a tasks touches elements, they will be updated automatically after the tasks is finished.

update_graph(graph)

Updates the graph of the current run.

This only has to be done if you want to update graph manually, if a tasks touches graph, they will be updated automatically after the tasks is finished.

exception bim2sim.tasks.base.TaskFailed

Bases: Exception