Skip to content

Commit

Permalink
added the mass to the bridge between the environment and the grow_div…
Browse files Browse the repository at this point in the history
…ide agent
  • Loading branch information
prismofeverything committed Nov 26, 2024
1 parent 377d951 commit 5781ab5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion process_bigraph/experiments/growth_division.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def grow_divide_agent(config=None, state=None, path=None):
state)

composite = generate_bridge({
'inputs': {},
'inputs': {'mass': ['mass']},
'outputs': agent_schema},
grow_divide_state)

Expand Down
23 changes: 18 additions & 5 deletions process_bigraph/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,8 @@ def test_grow_divide(core):

grow_divide = grow_divide_agent(
{'grow': {'rate': 0.03}},
{'mass': initial_mass},
{},
# {'mass': initial_mass},
['environment', '0'])

environment = {
Expand All @@ -567,14 +568,26 @@ def test_grow_divide(core):
'grow_divide': grow_divide}}}

composite = Composite({
'state': environment},
'state': environment,
'bridge': {
'inputs': {
'environment': ['environment']}}},
core=core)

updates = composite.update(
{},
import ipdb; ipdb.set_trace()

updates = composite.update({
'environment': {
'0': {
'mass': 1.1}}},
100.0)

assert '0_0_0_0_0' in composite.state['environment']
import ipdb; ipdb.set_trace()

# TODO: mass is not synchronized between inside and outside the composite?

assert '0_0_0_0_1' in composite.state['environment']
assert composite.state['environment']['0_0_0_0_1']['mass'] == composite.state['environment']['0_0_0_0_1']['grow_divide']['instance'].state['mass']


def test_gillespie_composite(core):
Expand Down

0 comments on commit 5781ab5

Please sign in to comment.