andes.core.service.VarHold#

class andes.core.service.VarHold(u, hold, vtype=None, name=None, tex_name=None, info=None)[source]#

Service for holding the input when the hold signal is on.

Parameters:
holdv-provider, binary

Hold signal array with length equal to the input. For elements that are 1, the corresponding inputs are held until the hold signal returns to 0.

__init__(u, hold, vtype=None, name=None, tex_name=None, info=None)[source]#

Methods

assign_memory(n)

Assign memory for self.v and set the array to zero.

check(**kwargs)

Custom v_numeric function for checking the hold signal and calculating outputs.

get_names()

Return name in a list

restore_init()

No-op: VarService is recomputed each step.

snapshot_init()

No-op: VarService is recomputed each step.

Attributes

class_name

Return the class name

n

Return the count of values in self.v.