@space
class CartesianPlane:
x:float
y:float
@space
class Particle:
pos:CartesianPlane
vel:CartesianPlane
@block
def particleIntegrator(state: Point[Particle], input: Point[CartesianPlane])-> Point[Particle]:
#input is acceleration
#output is the new particle state
output = deepcopy(state)
output['pos']['x'] += state['particle']['vel']['x']
output['pos']['y'] += state['particle']['vel']['y']
output['vel']['x'] += input['x']
output['vel']['y'] += input['y']
return output
Additional context
I am working on the Cat & Laser pointer demo, and aiming to make the model as simple as possible. The most natural view of the systems is the below, which requires particle integrator (twice!) which requires 2 inputs to make sense.
I would like the following to be a valid block
Additional context I am working on the Cat & Laser pointer demo, and aiming to make the model as simple as possible. The most natural view of the systems is the below, which requires particle integrator (twice!) which requires 2 inputs to make sense.