-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#8 Separate private and public methods
- Loading branch information
1 parent
829bd79
commit 3f2ab24
Showing
6 changed files
with
350 additions
and
380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,19 @@ | ||
"""Module for the ChasteCellCycleModel class.""" | ||
|
||
from .chaste_model import ChasteModel | ||
|
||
|
||
class ChasteCellCycleModel(ChasteModel): | ||
"""Class for generating Chaste code for a Cell Cycle model from SBML data.""" | ||
|
||
def __init__(self, sbml_file: str, model_name: str = None) -> None: | ||
"""Initialise the ChasteCellCycleModel.""" | ||
pass | ||
|
||
def generate_hpp(self): | ||
"""Construct the Chaste header file from the SBML file.""" | ||
|
||
hpp = [] | ||
|
||
# Add header guards | ||
guard = self.model_name.upper() + "ODESYSTEMANDSRNMODEL_HPP_" | ||
hpp.append(f"#ifndef {guard}") | ||
hpp.append(f"#define {guard}") | ||
hpp.append("") | ||
|
||
# Add includes | ||
hpp.append( | ||
""" | ||
#include ChasteSerialization.hpp" | ||
#include <boost/serialization/base_object.hpp>" | ||
#include <boost/serialization/shared_ptr.hpp>" | ||
#include <cmath>" | ||
#include <iostream>" | ||
#include AbstractOdeSystem.hpp" | ||
""" | ||
) | ||
|
||
# Define the ODE System class | ||
compartments = self.get_compartments() | ||
compartment_decl = "\n ".join([f"double {c};"] for c in compartments) | ||
|
||
parameters = self.get_parameters() | ||
parameter_decl = "\n ".join([f"double {p};"] for p in parameters) | ||
|
||
ode_class_def = f""" | ||
class {self.ode_name} : public AbstractOdeSystem | ||
{{ | ||
private: | ||
// Compartments | ||
{compartment_decl} | ||
// Parameters | ||
{parameter_decl} | ||
"""Generate the header file for the Cell Cycle model.""" | ||
return "" | ||
|
||
// Vector to check if all events have been triggered | ||
std::vector<bool> eventsSatisfied; | ||
public: | ||
bool CalculateStoppingEvent(double time, const std::vector<double>& rY); | ||
void CheckAndUpdateEvents(double time, const std::vector<double>& rY); | ||
bool AreAllEventsSatisfied(double time, const std::vector<double>& rY); | ||
// Define Cell Cycle model using Wrappers. | ||
#include "SbmlCcmWrapperModel.hpp" | ||
#include "SbmlCcmWrapperModel.cpp" | ||
}}; | ||
""" | ||
|
||
def generate_code(self, output_directory=None): | ||
pass | ||
def generate_cpp(self): | ||
"""Generate the source file for the Cell Cycle model.""" | ||
return "" |
Oops, something went wrong.