-
Notifications
You must be signed in to change notification settings - Fork 114
BioFVM Interface #401
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
base: development
Are you sure you want to change the base?
BioFVM Interface #401
Conversation
| } | ||
|
|
||
| double Basic_Agent::get_total_volume() | ||
| double& Basic_Agent::get_total_volume() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a specialized setter for volume that sets the volume_is_changed flag. Are we sure we need to access this by reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void Basic_Agent::set_total_volume(double volume)
{
this->volume = volume;
volume_is_changed = true;
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah so this is necessary because now that Basic_Agent::get_total_volume() is virtual, it is clashing with Cell::get_total_volume(), which returns the reference.
So we either unify Cell's and Basic_Agents's get_total_volume to return double& or we can actually remove Cell::get_total_volume (since its deprecated) and keep double.
I am open to ideas
|
As requested, I make the BioFVM implementation choice dynamic. The dynamical choice is currently not very dynamic, it lives in Further, I reverted some parts of the code so that sample_projects changes are minimized. Still, there are some changes mainly related to the the basic agent abstraction. A consequence of this is that the sample projects are now skipping the BioFVM_implementation indirection and are hard-coded to use the original biofvm. |
This PR does not include the interface-related CMake changes - those will be brought in when #392 gets merged.
The PR introduces 2 main interface classes:
Microenvironment_InterfaceBasic_Agent_InterfaceThese interfaces are used throughout the rest of PhysiCell code instead of the concrete BioFVM classes so that we can support multiple BioFVM implementations.
As of now, the interfaces are very close to 1-to-1 copies of the concrete classes. In the next PR, which introduces a new BioFVM implementation, we will refine the interfaces further by removing internal methods.
BioFVM_Implementationclass is the pseudo-factory for the new implementation: The new implementation will have to implement the methods of this class that will operate with the concrete classes of the 2 aforementioned interfaces.The code change is big, but it is mainly just a necessary syntactic change to support proper interface isolation. However, here are the major logic changes:
modulestoBioFVMdirectoryBioFVM_Implementation::initialize_microenvironment();that will initialize a BioFVM implementation for the further modification and useall_basic_agentsare now only accessible viaBioFVM_Implementation::get_all_basic_agentsfor the sake of hiding implementation details