-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Motility interface #82
Conversation
…comment out Xie model
…are not `nothing`
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #82 +/- ##
==========================================
+ Coverage 38.71% 41.58% +2.86%
==========================================
Files 22 22
Lines 452 505 +53
==========================================
+ Hits 175 210 +35
- Misses 277 295 +18 ☔ View full report in Codecov by Sentry. |
Closes #78 and closes #77
Full rewrite of the motility interface.
Current version is extremely more flexible although the complexity of
microbe_step!
has increased a bit.Motility{N}
type represents a motile pattern as a series ofN
MotileState
s with prescribed transition probabilities.Run
,Tumble
,Reverse
,Flick
,Stop
) or custom ones (viaRunState
orTurnState
)turn_rate
has been removed from microbe types; instead, eachMotileState
has aduration
field. With this approach, also rotations can have finite durations (Tumbles of finite duration #77)AbstractMicrobe
now has two type parameters:D
for dimensionality andN
for the number of steps in the motile pattern.The potential problems raised in #78 are not crucial and the usage of the
Motility{N}
even if not fully concrete brings, per se, even some minor performance improvements and significant improvements in memory usage.However, a performance bottleneck comes from the need to allow instantaneous turns (i.e.
TurnState
instances withduration=0
) by branching insidemicrobe_step!
; this is inefficient but it's the easiest way I have found to recover the past behavior (which I want to keep because it's the limit where simulations can be compared with theoretical results).All in all, the performance is on par with v0.3, but memory usage is improved and the library is much more flexible. Will may be work on performance optimizations further down the road