finam.ITimeComponent#

class finam.ITimeComponent[source]#

Bases: IComponent, ABC

Interface for components with a time step.

Attributes:
inputs

IOList: The component’s inputs.

metadata

The component’s meta data.

name

Component name.

next_time

The component’s predicted simulation time of the next pulls.

outputs

IOList: The component’s outputs.

status

The component’s current status.

time

The component’s current simulation time.

Methods

connect(start_time)

Connect exchange data and metadata with linked components.

finalize()

Finalize and clean up the component.

initialize()

Initialize the component.

update()

Update the component by one time step.

validate()

Validate the correctness of the component's settings and coupling.

abstract property time#

The component’s current simulation time.

abstract property next_time#

The component’s predicted simulation time of the next pulls.

Can be None if the component has no inputs.

abstract connect(start_time)#

Connect exchange data and metadata with linked components.

The method can be called multiple times if there are failed pull attempts.

After each method call, the component should have status ComponentStatus.CONNECTED if connecting was completed, ComponentStatus.CONNECTING if some but not all required initial input(s) could be pulled, and ComponentStatus.CONNECTING_IDLE if nothing could be pulled.

Parameters:

start_time (datetime) – The composition’s starting time. Can be before the component’s actual time.

abstract finalize()#

Finalize and clean up the component.

After the method call, the component should have status ComponentStatus.FINALIZED.

abstract initialize()#

Initialize the component.

After the method call, the component’s inputs and outputs must be available, and the component should have status ComponentStatus.INITIALIZED.

abstract property inputs#

The component’s inputs.

Type:

IOList

abstract property metadata#

The component’s meta data. Will only be called after the connect phase of the composition.

abstract property name#

Component name.

abstract property outputs#

The component’s outputs.

Type:

IOList

abstract property status#

The component’s current status.

abstract update()#

Update the component by one time step. Push new values to outputs.

After the method call, the component should have status ComponentStatus.UPDATED or ComponentStatus.FINISHED.

abstract validate()#

Validate the correctness of the component’s settings and coupling.

After the method call, the component should have status ComponentStatus.VALIDATED.