mastrof / MicrobeAgents.jl

Agent-based modeling of microbial motile behavior via Agents.jl
MIT License
2 stars 1 forks source link

Implement an abstract `Chemotaxis` type to be used as field in `Microbe` #55

Open mastrof opened 1 year ago

mastrof commented 1 year ago

Instead of defining a different AbstractMicrobe type for each model of chemotaxis, there could be a single Microbe type with a parameter C<:Chemotaxis and a field chemotaxis::C field which would wrap the entire chemotactic system of the microbe.

Rather than enforcing a structure to follow for new microbe types, it would then only be required for the Chemotaxis struct to follow some prescribed rules.

Such a refactoring might also make it easier to implement further behavioral traits down the road (e.g. chemokinesis, interactions...) and separate the integration of "internal states" from the motion itself.

Types, however, are an issue. Fast execution requires the struct types to be concretely typed (which is also a problem for AbstractMotility right now), which means that each behavioral trait would need its own parameter if a generic interface is to be provided. This will eventually lead to breaking changes whenever new traits with their own type have to be added, and will require Microbe to store a load of type parameters most of which are not going to be used simultaneously in typical scenarios.

mastrof commented 7 months ago

This is probably not a good idea. The rewrite of motility types (#78) should provide a relatively robust interface and allow for efficient models without modifying the current implementation of chemotaxis