diff --git a/model/Clinical/CMDecisionTree.cpp b/model/Clinical/CMDecisionTree.cpp index cd52798e..f18973a5 100644 --- a/model/Clinical/CMDecisionTree.cpp +++ b/model/Clinical/CMDecisionTree.cpp @@ -120,6 +120,44 @@ class CMDTCaseType : public CMDecisionTree { const CMDecisionTree& secondLine; }; +/** + * Should the patient recieve a different treatment based on its infection type? + */ +class CMDTInfectionOrigin : public CMDecisionTree { +public: + static const CMDecisionTree& create( const ::scnXml::DTInfectionOrigin& node, bool isUC ); + +protected: + virtual bool operator==( const CMDecisionTree& that ) const{ + if( this == &that ) return true; // short cut: same object thus equivalent + const CMDTInfectionOrigin* p = dynamic_cast( &that ); + if( p == 0 ) return false; // different type of node + if( imported != p->imported ) return false; + if( introduced != p->introduced ) return false; + if( indigenous != p->indigenous ) return false; + return true; // no tests failed; must be the same + } + + virtual CMDTOut exec( CMHostData hostData ) const{ + WithinHost::InfectionOrigin InfectionOrigin = hostData.withinHost().getInfectionOrigin(); + if(InfectionOrigin == WithinHost::InfectionOrigin::Imported) + return imported.exec( hostData ); + else if (InfectionOrigin == WithinHost::InfectionOrigin::Introduced) + return introduced.exec( hostData ); + else + return indigenous.exec( hostData ); + } + +private: + CMDTInfectionOrigin( const CMDecisionTree& imported, + const CMDecisionTree& introduced, + const CMDecisionTree& indigenous ) : + imported(imported), introduced(introduced), indigenous(indigenous) + {} + + const CMDecisionTree& imported, &introduced, &indigenous; +}; + /** * Use a diagnostic, and call another decision tree based on the outcome. */ @@ -603,6 +641,7 @@ const CMDecisionTree& CMDecisionTree::create( const scnXml::DecisionTree& node, if( node.getMultiple().present() ) return CMDTMultiple::create( node.getMultiple().get(), isUC); // branching nodes if( node.getCaseType().present() ) return CMDTCaseType::create( node.getCaseType().get(), isUC); + if( node.getInfectionOrigin().present() ) return CMDTInfectionOrigin::create( node.getInfectionOrigin().get(), isUC); if( node.getDiagnostic().present() ) return CMDTDiagnostic::create( node.getDiagnostic().get(), isUC); if( node.getUncomplicated().present() ) return CMDTUncomplicated::create( node.getUncomplicated().get(), isUC); if( node.getSevere().present() ) return CMDTSevere::create( node.getSevere().get(), true); @@ -628,6 +667,9 @@ const CMDecisionTree& CMDTMultiple::create( const scnXml::DTMultiple& node, bool for( const scnXml::DTCaseType& sn : node.getCaseType() ){ self->children.push_back( &CMDTCaseType::create(sn, isUC) ); } + for( const scnXml::DTInfectionOrigin& sn : node.getInfectionOrigin() ){ + self->children.push_back( &CMDTInfectionOrigin::create(sn, isUC) ); + } for( const scnXml::DTDiagnostic& sn : node.getDiagnostic() ){ self->children.push_back( &CMDTDiagnostic::create(sn, isUC) ); } @@ -671,6 +713,17 @@ const CMDecisionTree& CMDTCaseType::create( const scnXml::DTCaseType& node, bool ) ); } +const CMDecisionTree& CMDTInfectionOrigin::create( const scnXml::DTInfectionOrigin& node, bool isUC ){ + if( !isUC ){ + throw util::xml_scenario_error( "decision tree: caseType can only be used for uncomplicated cases" ); + } + return save_decision( new CMDTInfectionOrigin( + CMDecisionTree::create( node.getImported(), isUC ), + CMDecisionTree::create( node.getIntroduced(), isUC ), + CMDecisionTree::create( node.getIndigenous(), isUC ) + ) ); +} + const CMDecisionTree& CMDTDiagnostic::create( const scnXml::DTDiagnostic& node, bool isUC ){ return save_decision( new CMDTDiagnostic( diagnostics::get( node.getDiagnostic() ), diff --git a/model/Clinical/Episode.cpp b/model/Clinical/Episode.cpp index e5f3cd07..2324f839 100644 --- a/model/Clinical/Episode.cpp +++ b/model/Clinical/Episode.cpp @@ -48,7 +48,7 @@ void Episode::update (const Host::Human& human, Episode::State newState) toReport = true; if(toReport) { - infectionType = human.withinHostModel->getInfectionType(); + infectionType = human.withinHostModel->getInfectionOrigin(); report (); diff --git a/model/Host/WithinHost/CommonWithinHost.cpp b/model/Host/WithinHost/CommonWithinHost.cpp index bd897275..d29bd913 100644 --- a/model/Host/WithinHost/CommonWithinHost.cpp +++ b/model/Host/WithinHost/CommonWithinHost.cpp @@ -260,30 +260,14 @@ void CommonWithinHost::update(Host::Human &human, LocalRng& rng, int &nNewInfs_i m_y_lag_l[y_lag_i * Genotypes::N() + g] = 0.0; } - int nImported = 0, nIntroduced = 0, nIndigenous = 0; for( auto inf = infections.begin(); inf != infections.end(); ++inf ) { if((*inf)->origin() == InfectionOrigin::Imported) m_y_lag_i[y_lag_i * Genotypes::N() + (*inf)->genotype()] += (*inf)->getDensity(); else m_y_lag_l[y_lag_i * Genotypes::N() + (*inf)->genotype()] += (*inf)->getDensity(); - - if((*inf)->origin() == InfectionOrigin::Indigenous) nIndigenous++; - else if((*inf)->origin() == InfectionOrigin::Introduced) nIntroduced++; - else nImported++; } - /* The rules are: - - Imported only if all infections are imported - - Introduced if at least one Introduced - - Indigenous otherwise (Imported + Indigenous or just Indigenous infections) */ - if(nIntroduced > 0) - infectionType = InfectionOrigin::Introduced; - else if(nIndigenous > 0) - infectionType = InfectionOrigin::Indigenous; - else - infectionType = InfectionOrigin::Imported; - // This is a bug, we keep it this way to be consistent with old simulations if(nNewInfsIgnored > 0) nNewInfs_l += nNewInfsIgnored; @@ -294,6 +278,10 @@ void CommonWithinHost::addProphylacticEffects(const vector& pClearanceBy throw util::unimplemented_exception( "prophylactic effects on 1-day time step" ); } +InfectionOrigin CommonWithinHost::getInfectionOrigin()const +{ + return get_infection_origin(infections); +} // ----- Summarize ----- @@ -309,6 +297,8 @@ bool CommonWithinHost::summarize( Host::Human& human )const{ pathogenesisModel->summarize( human ); pkpdModel.summarize( human ); + InfectionOrigin infectionType = get_infection_origin(infections); + // If the number of infections is 0 and parasite density is positive we default to Indigenous if( infections.size() > 0 ){ mon::reportStatMHI( mon::MHR_INFECTED_HOSTS, human, 1 ); diff --git a/model/Host/WithinHost/CommonWithinHost.h b/model/Host/WithinHost/CommonWithinHost.h index a74e3431..9bcdd1b0 100644 --- a/model/Host/WithinHost/CommonWithinHost.h +++ b/model/Host/WithinHost/CommonWithinHost.h @@ -66,6 +66,8 @@ class CommonWithinHost : public WHFalciparum static CommonInfection* (* createInfection) (LocalRng& rng, uint32_t protID, int origin); static CommonInfection* (* checkpointedInfection) (istream& stream); //@} + + virtual InfectionOrigin getInfectionOrigin() const; virtual bool summarize( Host::Human& human )const; diff --git a/model/Host/WithinHost/DescriptiveWithinHost.cpp b/model/Host/WithinHost/DescriptiveWithinHost.cpp index 9a428189..772c4de2 100644 --- a/model/Host/WithinHost/DescriptiveWithinHost.cpp +++ b/model/Host/WithinHost/DescriptiveWithinHost.cpp @@ -28,6 +28,7 @@ #include "util/ModelOptions.h" #include "util/StreamValidator.h" #include "util/errors.h" + #include using namespace std; @@ -50,21 +51,27 @@ DescriptiveWithinHostModel::DescriptiveWithinHostModel( LocalRng& rng, double co opt_vaccine_genotype = util::ModelOptions::option (util::VACCINE_GENOTYPE); } -DescriptiveWithinHostModel::~DescriptiveWithinHostModel() {} +DescriptiveWithinHostModel::~DescriptiveWithinHostModel() { + for( auto inf = infections.begin(); inf != infections.end(); ++inf ){ + delete *inf; + } + infections.clear(); +} // ----- Simple infection adders/removers ----- void DescriptiveWithinHostModel::loadInfection(istream& stream) { - infections.push_back(DescriptiveInfection(stream)); + infections.push_back(new DescriptiveInfection(stream)); } void DescriptiveWithinHostModel::clearInfections( Treatments::Stages stage ){ for(auto inf = infections.begin(); inf != infections.end();) { if( stage == Treatments::BOTH || - (stage == Treatments::LIVER && !inf->bloodStage()) || - (stage == Treatments::BLOOD && inf->bloodStage()) + (stage == Treatments::LIVER && !(*inf)->bloodStage()) || + (stage == Treatments::BLOOD && (*inf)->bloodStage()) ){ + delete *inf; inf = infections.erase( inf ); }else{ ++inf; @@ -77,11 +84,12 @@ void DescriptiveWithinHostModel::clearInfections( Treatments::Stages stage ){ void DescriptiveWithinHostModel::clearImmunity() { for(auto inf = infections.begin(); inf != infections.end(); ++inf) { - inf->clearImmunity(); + (*inf)->clearImmunity(); } m_cumulative_h = 0.0; m_cumulative_Y_lag = 0.0; } + void DescriptiveWithinHostModel::importInfection(LocalRng& rng, int origin){ if( numInfs < MAX_INFECTIONS ){ m_cumulative_h += 1; @@ -90,7 +98,8 @@ void DescriptiveWithinHostModel::importInfection(LocalRng& rng, int origin){ // should use initial frequencies to select genotypes. vector weights( 0 ); // zero length: signal to use initial frequencies uint32_t genotype = Genotypes::sampleGenotype(rng, weights); - infections.push_back(DescriptiveInfection(rng, genotype, origin)); + infections.push_back(new DescriptiveInfection(rng, genotype, origin)); + } assert( numInfs == static_cast(infections.size()) ); } @@ -119,10 +128,10 @@ void DescriptiveWithinHostModel::update(Host::Human &human, LocalRng& rng, int & { double vaccineFactor = human.vaccine.getFactor( interventions::Vaccine::PEV, genotype ); if(vaccineFactor == 1.0 || human.rng.bernoulli(vaccineFactor)) - infections.push_back(DescriptiveInfection (rng, genotype, InfectionOrigin::Introduced)); + infections.push_back(new DescriptiveInfection (rng, genotype, InfectionOrigin::Introduced)); } else if (opt_vaccine_genotype == false) - infections.push_back(DescriptiveInfection (rng, genotype, InfectionOrigin::Introduced)); + infections.push_back(new DescriptiveInfection (rng, genotype, InfectionOrigin::Introduced)); } assert( numInfs == static_cast(infections.size()) ); @@ -136,10 +145,10 @@ void DescriptiveWithinHostModel::update(Host::Human &human, LocalRng& rng, int & { double vaccineFactor = human.vaccine.getFactor( interventions::Vaccine::PEV, genotype ); if(vaccineFactor == 1.0 || human.rng.bernoulli(vaccineFactor)) - infections.push_back(DescriptiveInfection (rng, genotype, InfectionOrigin::Indigenous)); + infections.push_back(new DescriptiveInfection (rng, genotype, InfectionOrigin::Indigenous)); } else if (opt_vaccine_genotype == false) - infections.push_back(DescriptiveInfection (rng, genotype, InfectionOrigin::Indigenous)); + infections.push_back(new DescriptiveInfection (rng, genotype, InfectionOrigin::Indigenous)); } assert( numInfs == static_cast(infections.size()) ); @@ -160,9 +169,10 @@ void DescriptiveWithinHostModel::update(Host::Human &human, LocalRng& rng, int & // any more). // SP drug action and the PK/PD model would need to be abstracted // behind a common interface. - if ( inf->expired() /* infection has self-terminated */ || - (inf->bloodStage() ? treatmentBlood : treatmentLiver) ) + if ( (*inf)->expired() /* infection has self-terminated */ || + ((*inf)->bloodStage() ? treatmentBlood : treatmentLiver) ) { + delete *inf; inf=infections.erase(inf); numInfs--; continue; @@ -171,18 +181,18 @@ void DescriptiveWithinHostModel::update(Host::Human &human, LocalRng& rng, int & // Should be: infStepMaxDens = 0.0, but has some history. // See MAX_DENS_CORRECTION in DescriptiveInfection.cpp. double infStepMaxDens = timeStepMaxDensity; - double immSurvFact = immunitySurvivalFactor(ageInYears, inf->cumulativeExposureJ()); - double bsvFactor = human.vaccine.getFactor(interventions::Vaccine::BSV, opt_vaccine_genotype? inf->genotype() : 0); + double immSurvFact = immunitySurvivalFactor(ageInYears, (*inf)->cumulativeExposureJ()); + double bsvFactor = human.vaccine.getFactor(interventions::Vaccine::BSV, opt_vaccine_genotype? (*inf)->genotype() : 0); - inf->determineDensities(rng, m_cumulative_h, infStepMaxDens, immSurvFact, _innateImmSurvFact, bsvFactor); + (*inf)->determineDensities(rng, m_cumulative_h, infStepMaxDens, immSurvFact, _innateImmSurvFact, bsvFactor); if (bugfix_max_dens) infStepMaxDens = std::max(infStepMaxDens, timeStepMaxDensity); timeStepMaxDensity = infStepMaxDens; - double density = inf->getDensity(); + double density = (*inf)->getDensity(); totalDensity += density; - if( !inf->isHrp2Deficient() ){ + if( !(*inf)->isHrp2Deficient() ){ hrp2Density += density; } @@ -207,30 +217,14 @@ void DescriptiveWithinHostModel::update(Host::Human &human, LocalRng& rng, int & m_y_lag_l[y_lag_i * Genotypes::N() + g] = 0.0; } - int nImported = 0, nIntroduced = 0, nIndigenous = 0; for( auto inf = infections.begin(); inf != infections.end(); ++inf ) { - if(inf->origin() == InfectionOrigin::Imported) - m_y_lag_i[y_lag_i * Genotypes::N() + inf->genotype()] += inf->getDensity(); + if((*inf)->origin() == InfectionOrigin::Imported) + m_y_lag_i[y_lag_i * Genotypes::N() + (*inf)->genotype()] += (*inf)->getDensity(); else - m_y_lag_l[y_lag_i * Genotypes::N() + inf->genotype()] += inf->getDensity(); - - if(inf->origin() == InfectionOrigin::Indigenous) nIndigenous++; - else if(inf->origin() == InfectionOrigin::Introduced) nIntroduced++; - else nImported++; + m_y_lag_l[y_lag_i * Genotypes::N() + (*inf)->genotype()] += (*inf)->getDensity(); } - /* The rules are: - - Imported only if all infections are imported - - Introduced if at least one Introduced - - Indigenous otherwise (Imported + Indigenous or just Indigenous infections) */ - if(nIntroduced > 0) - infectionType = InfectionOrigin::Introduced; - else if(nIndigenous > 0) - infectionType = InfectionOrigin::Indigenous; - else - infectionType = InfectionOrigin::Imported; - // This is a bug, we keep it this way to be consistent with old simulations if(opt_vaccine_genotype == false) { @@ -239,12 +233,18 @@ void DescriptiveWithinHostModel::update(Host::Human &human, LocalRng& rng, int & } } +InfectionOrigin DescriptiveWithinHostModel::getInfectionOrigin()const +{ + return get_infection_origin(infections); +} // ----- Summarize ----- bool DescriptiveWithinHostModel::summarize( Host::Human& human )const{ pathogenesisModel->summarize( human ); + InfectionOrigin infectionType = get_infection_origin(infections); + // If the number of infections is 0 and parasite density is positive we default to Indigenous if( infections.size() > 0 ){ mon::reportStatMHI( mon::MHR_INFECTED_HOSTS, human, 1 ); @@ -258,8 +258,8 @@ bool DescriptiveWithinHostModel::summarize( Host::Human& human )const{ int nImported = 0, nIntroduced = 0, nIndigenous = 0; for( auto inf = infections.begin(); inf != infections.end(); ++inf ) { - if(inf->origin() == InfectionOrigin::Indigenous) nIndigenous++; - else if(inf->origin() == InfectionOrigin::Introduced) nIntroduced++; + if((*inf)->origin() == InfectionOrigin::Indigenous) nIndigenous++; + else if((*inf)->origin() == InfectionOrigin::Introduced) nIntroduced++; else nImported++; } @@ -271,14 +271,14 @@ bool DescriptiveWithinHostModel::summarize( Host::Human& human )const{ mon::reportStatMHGI( mon::MHR_INFECTIONS_INDIGENOUS, human, 0, nIndigenous ); if( reportPatentInfected ){ - for(std::list::const_iterator inf = infections.begin(); inf != infections.end(); ++inf) + for(auto inf = infections.begin(); inf != infections.end(); ++inf) { - if( diagnostics::monitoringDiagnostic().isPositive( human.rng, inf->getDensity(), std::numeric_limits::quiet_NaN() ) ) + if( diagnostics::monitoringDiagnostic().isPositive( human.rng, (*inf)->getDensity(), std::numeric_limits::quiet_NaN() ) ) { mon::reportStatMHGI( mon::MHR_PATENT_INFECTIONS, human, 0, 1 ); - if(inf->origin() == InfectionOrigin::Indigenous) + if((*inf)->origin() == InfectionOrigin::Indigenous) mon::reportStatMHGI( mon::MHR_PATENT_INFECTIONS_INDIGENOUS, human, 0, 1 ); - else if(inf->origin() == InfectionOrigin::Introduced) + else if((*inf)->origin() == InfectionOrigin::Introduced) mon::reportStatMHGI( mon::MHR_PATENT_INFECTIONS_INTRODUCED, human, 0, 1 ); else mon::reportStatMHGI( mon::MHR_PATENT_INFECTIONS_IMPORTED, human, 0, 1 ); @@ -288,9 +288,8 @@ bool DescriptiveWithinHostModel::summarize( Host::Human& human )const{ if( reportInfectionsByGenotype ){ // accumulate total density by genotype map dens_by_gtype; - for( const DescriptiveInfection& inf: infections ){ - dens_by_gtype[inf.genotype()] += inf.getDensity(); - } + for(auto inf = infections.begin(); inf != infections.end(); ++inf) + dens_by_gtype[(*inf)->genotype()] += (*inf)->getDensity(); for( auto gtype: dens_by_gtype ){ // we had at least one infection of this genotype @@ -334,8 +333,8 @@ void DescriptiveWithinHostModel::checkpoint (istream& stream) { } void DescriptiveWithinHostModel::checkpoint (ostream& stream) { WHFalciparum::checkpoint (stream); - for(DescriptiveInfection& inf : infections) { - inf & stream; + for(auto inf = infections.begin(); inf != infections.end(); ++inf){ + *inf & stream; } } diff --git a/model/Host/WithinHost/DescriptiveWithinHost.h b/model/Host/WithinHost/DescriptiveWithinHost.h index f3087c6d..c46ee84d 100644 --- a/model/Host/WithinHost/DescriptiveWithinHost.h +++ b/model/Host/WithinHost/DescriptiveWithinHost.h @@ -52,7 +52,9 @@ class DescriptiveWithinHostModel : public WHFalciparum { virtual void update(Host::Human &human, LocalRng& rng, int &nNewInfs_i, int &nNewInfs_l, vector& genotype_weights_i, vector& genotype_weights_l, double ageInYears); - virtual bool summarize( Host::Human& human )const; + virtual InfectionOrigin getInfectionOrigin() const; + + virtual bool summarize( Host::Human& human ) const; protected: virtual void clearInfections( Treatments::Stages stage ); @@ -67,7 +69,7 @@ class DescriptiveWithinHostModel : public WHFalciparum { * * Since infection models and within host models are very much intertwined, * the idea is that each WithinHostModel has its own list of infections. */ - std::list infections; + std::list infections; bool opt_vaccine_genotype = false; }; diff --git a/model/Host/WithinHost/Infection/Infection.h b/model/Host/WithinHost/Infection/Infection.h index 3cf2b7ef..fe61609d 100644 --- a/model/Host/WithinHost/Infection/Infection.h +++ b/model/Host/WithinHost/Infection/Infection.h @@ -154,5 +154,31 @@ class Infection { friend class ::UnittestUtil; }; +template +InfectionOrigin get_infection_origin(const std::list &infections) +{ + if(infections.empty()) + return InfectionOrigin::Indigenous; + + int nImported = 0, nIntroduced = 0, nIndigenous = 0; + for( auto inf = infections.begin(); inf != infections.end(); ++inf ) + { + if((*inf)->origin() == InfectionOrigin::Indigenous) nIndigenous++; + else if((*inf)->origin() == InfectionOrigin::Introduced) nIntroduced++; + else nImported++; + } + + /* The rules are: + - Imported only if all infections are imported + - Introduced if at least one Introduced + - Indigenous otherwise (Imported + Indigenous or just Indigenous infections) */ + if(nIntroduced > 0) + return InfectionOrigin::Introduced; + else if(nIndigenous > 0) + return InfectionOrigin::Indigenous; + else + return InfectionOrigin::Imported; +} + } } #endif diff --git a/model/Host/WithinHost/WHFalciparum.h b/model/Host/WithinHost/WHFalciparum.h index 032c72a7..34181601 100644 --- a/model/Host/WithinHost/WHFalciparum.h +++ b/model/Host/WithinHost/WHFalciparum.h @@ -70,10 +70,6 @@ class WHFalciparum : public WHInterface { virtual Pathogenesis::StatePair determineMorbidity( Host::Human& human, double ageYears, bool isDoomed ); - virtual InfectionOrigin getInfectionType() const { - return infectionType; - } - inline double getCumulative_h() const { return m_cumulative_h; } @@ -141,8 +137,6 @@ class WHFalciparum : public WHInterface { /// End of step on which treatment expires = start of first step after expiry SimTime treatExpiryLiver, treatExpiryBlood; - InfectionOrigin infectionType = InfectionOrigin::Indigenous; - virtual void checkpoint (istream& stream); virtual void checkpoint (ostream& stream); diff --git a/model/Host/WithinHost/WHInterface.h b/model/Host/WithinHost/WHInterface.h index ca8772e9..c3cc7068 100644 --- a/model/Host/WithinHost/WHInterface.h +++ b/model/Host/WithinHost/WHInterface.h @@ -194,7 +194,7 @@ class WHInterface { virtual double getCumulative_h() const =0; virtual double getCumulative_Y() const =0; - virtual InfectionOrigin getInfectionType() const =0; + virtual InfectionOrigin getInfectionOrigin() const =0; /** The maximum number of infections a human can have. The only real reason * for this limit is to prevent incase bad input from causing the number of diff --git a/model/Host/WithinHost/WHVivax.h b/model/Host/WithinHost/WHVivax.h index bef65c62..11f1ab79 100644 --- a/model/Host/WithinHost/WHVivax.h +++ b/model/Host/WithinHost/WHVivax.h @@ -167,7 +167,7 @@ class WHVivax : public WHInterface { virtual void clearImmunity(); - virtual InfectionOrigin getInfectionType() const { + virtual InfectionOrigin getInfectionOrigin() const { return InfectionOrigin::Indigenous; } diff --git a/schema/healthSystem.xsd b/schema/healthSystem.xsd index acffe36a..a3900eff 100644 --- a/schema/healthSystem.xsd +++ b/schema/healthSystem.xsd @@ -672,6 +672,7 @@ Licence: GNU General Public Licence version 2 or later (see COPYING) --> + @@ -712,6 +713,7 @@ Licence: GNU General Public Licence version 2 or later (see COPYING) --> + @@ -756,6 +758,33 @@ Licence: GNU General Public Licence version 2 or later (see COPYING) --> + + + + A switch which choses a branch deterministically, based on whether the + patient has an imported, introduced or indigenous infection. + + If the patient is not infected, this will execute the indigenous branch by + default. You must use a diagnostic test first to find out if the patient is infected. + + If there are no imported cases, all infections will appear indigenous. + + name:Switch (imported, introduced, indigenous); + + + + + + + + + + An optional piece of documentation attached to this node. + + name:Name; + + + diff --git a/unittest/WHMock.cpp b/unittest/WHMock.cpp index d2126c48..2e0f95b1 100644 --- a/unittest/WHMock.cpp +++ b/unittest/WHMock.cpp @@ -94,7 +94,7 @@ double WHMock::getCumulative_Y() const{ throw util::unimplemented_exception( "not needed in unit test" ); } -InfectionOrigin WHMock::getInfectionType() const{ +InfectionOrigin WHMock::getInfectionOrigin() const{ return InfectionOrigin::Indigenous; } diff --git a/unittest/WHMock.h b/unittest/WHMock.h index 531d45ed..b3126e33 100644 --- a/unittest/WHMock.h +++ b/unittest/WHMock.h @@ -59,7 +59,7 @@ class WHMock : public WHInterface { virtual void clearImmunity(); virtual double getCumulative_h() const; virtual double getCumulative_Y() const; - virtual InfectionOrigin getInfectionType() const; + virtual InfectionOrigin getInfectionOrigin() const; // This mock class does not have actual infections. Just set this as you please. double totalDensity;