Skip to content

Commit

Permalink
working out interaction between cytosim and medyan
Browse files Browse the repository at this point in the history
  • Loading branch information
prismofeverything committed Mar 15, 2022
1 parent a4ac9b1 commit 4c8a9c7
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 73 deletions.
66 changes: 34 additions & 32 deletions in/cytosim-buckling.cym

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ CHEMISTRYFILE: chemistryinput.txt

CALGORITHM: NRM
NUMTOTALSTEPS:
RUNTIME: 4.999999900000001
RUNTIME: 1.0

NUMSTEPSPERS:
SNAPSHOTTIME: 1.0
Expand Down
18 changes: 13 additions & 5 deletions vivarium_models/composites/filament_alternatives.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,21 @@
from vivarium_models.processes.medyan import MedyanProcess
from vivarium_models.processes.cytosim import CytosimProcess

ALTERNATOR_PERIODS = [5.0, 5.0]
ALTERNATOR_PERIODS = [2.0, 2.0]

class FilamentAlternatives(Composer):
defaults = {
"periodic_event": {"periods": ALTERNATOR_PERIODS},
"medyan": {"time_step": 5.0, "_condition": ("choices", "medyan_active")},
"cytosim": {"time_step": 5.0, "_condition": ("choices", "cytosim_active")},
"medyan": {
"time_step": 1.0,
"_condition": ("choices", "medyan_active")},
"cytosim": {
"time_step": 1.0,
"_condition": ("choices", "cytosim_active"),
'confine': {
'side': 'inside',
'force': 100,
'space': 'cell'}},
"alternator": {"choices": ["medyan_active", "cytosim_active"]},
}

Expand Down Expand Up @@ -282,7 +290,7 @@ def test_filament_alternatives():

medyan_config = {
"medyan_executable": args.medyan_executable_path, # "...../medyan/build/medyan"
"transform_points": [0, 0, 0],
"transform_points": [2000, 1000, 1000],
}

filament_alternatives_config = {'medyan': medyan_config}
Expand All @@ -301,7 +309,7 @@ def test_filament_alternatives():

import ipdb; ipdb.set_trace()

engine.update(30)
engine.update(10)

engine.emitter.get_data()

Expand Down
15 changes: 4 additions & 11 deletions vivarium_models/processes/cytosim.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
NAME = "CYTOSIM"

RELATIVE_MICRON = 0.001
BOUNDARY_BUFFER = 0.95

def fiber_section(id, fiber):
points = fiber['points']
Expand Down Expand Up @@ -103,18 +104,10 @@ def __init__(self, parameters=None):

def ports_schema(self):
ports = fibers_schema()
ports['choices'] = {
'medyan_active': {
'_default': True,
'_emit': True},
'readdy_active': {
'_default': False,
'_emit': True}}

return ports

def calculate_timestep(self, state):
return 0.1
# def calculate_timestep(self, state):
# return 0.1

def initial_state(self, config):
return {}
Expand All @@ -125,7 +118,7 @@ def next_update(self, timestep, state):

fiber_sections = [fiber_section(id, fiber) for id, fiber in initial_fibers.items()]

box_extent = state['fibers_box_extent'] * RELATIVE_MICRON
box_extent = state['fibers_box_extent'] * RELATIVE_MICRON * BOUNDARY_BUFFER

template = env.get_template(self.parameters['cytosim_template'])
cytosim_config = template.render(
Expand Down
2 changes: 1 addition & 1 deletion vivarium_models/processes/medyan.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class MedyanProcess(Process):
def __init__(self, parameters=None):
super().__init__(parameters)

assert self.parameters["time_step"] > self.parameters["snapshot"]
assert self.parameters["time_step"] >= self.parameters["snapshot"]

def ports_schema(self):
return fibers_schema()
Expand Down

0 comments on commit 4c8a9c7

Please sign in to comment.