void SusceptibilityVector::serialize(IArchive& ar, SusceptibilityVector* obj) { SusceptibilityVector& susceptibility = *obj; Susceptibility::serialize(ar, obj); ar.labelElement("m_relative_biting_rate") & susceptibility.m_relative_biting_rate; ar.labelElement("m_age_dependent_biting_risk") & susceptibility.m_age_dependent_biting_risk; }
void AbstractBednet::serialize( IArchive& ar, AbstractBednet* obj ) { BaseIntervention::serialize( ar, obj ); AbstractBednet& bednet = *obj; ar.labelElement( "m_pEffectBlocking" ) & bednet.m_pEffectBlocking; ar.labelElement( "m_pEffectKilling" ) & bednet.m_pEffectKilling; }
void serialize(IArchive& ar, IndividualHumanMalaria::gametocytes_strain_map_t& mapping) { size_t count = ar.IsWriter() ? mapping.size() : -1; ar.startArray(count); if (ar.IsWriter()) { for (auto& entry : mapping) { StrainIdentity* strain = const_cast<StrainIdentity*>(&entry.first); ar.startObject(); ar.labelElement("key"); serialize(ar, strain); ar.labelElement("value") & entry.second; ar.endObject(); } } else { for (size_t i = 0; i < count; i++) { StrainIdentity* strain; int64_t value; ar.startObject(); ar.labelElement("key"); serialize(ar, strain); ar.labelElement("value") & value; ar.endObject(); mapping[*strain] = value; } } ar.endArray(); }
void BaseIntervention::serialize(IArchive& ar, BaseIntervention* obj) { BaseIntervention& intervention = *obj; ar.labelElement("cost_per_unit" ) & intervention.cost_per_unit; ar.labelElement("expired" ) & intervention.expired; ar.labelElement("dont_allow_duplicates") & intervention.dont_allow_duplicates; }
void HIVARTStagingByCD4Diagnostic::serialize(IArchive& ar, HIVARTStagingByCD4Diagnostic* obj) { HIVARTStagingAbstract::serialize( ar, obj ); HIVARTStagingByCD4Diagnostic& diag = *obj; ar.labelElement("threshold" ) & diag.threshold; ar.labelElement("ifActiveTB") & diag.ifActiveTB; ar.labelElement("ifPregnant") & diag.ifPregnant; }
void InterventionsContainer::serialize(IArchive& ar, InterventionsContainer* obj) { InterventionsContainer& container = *obj; ar.labelElement("drugVaccineReducedAcquire") & container.drugVaccineReducedAcquire; ar.labelElement("drugVaccineReducedTransmit") & container.drugVaccineReducedTransmit; ar.labelElement("drugVaccineReducedMortality") & container.drugVaccineReducedMortality; ar.labelElement("interventions") & container.interventions; }
void SimpleVaccine::serialize(IArchive& ar, SimpleVaccine* obj) { BaseIntervention::serialize( ar, obj ); SimpleVaccine& vaccine = *obj; ar.labelElement("vaccine_type") & vaccine.vaccine_type; ar.labelElement("vaccine_take") & vaccine.vaccine_take; ar.labelElement("vaccine_took") & vaccine.vaccine_took; ar.labelElement("waning_effect") & vaccine.waning_effect; }
void IndividualHumanVector::serialize(IArchive& ar, IndividualHumanVector* obj) { IndividualHumanVector& individual = *obj; IndividualHuman::serialize(ar, obj); ar.labelElement("m_strain_exposure"); Kernel::serialize(ar, individual.m_strain_exposure); ar.labelElement("m_total_exposure") & individual.m_total_exposure; }
void HIVSimpleDiagnostic::serialize(IArchive& ar, HIVSimpleDiagnostic* obj) { SimpleDiagnostic::serialize( ar, obj ); HIVSimpleDiagnostic& hsd = *obj; ar.labelElement("firstUpdate" ) & hsd.firstUpdate; ar.labelElement("result_of_positive_test" ) & hsd.result_of_positive_test; ar.labelElement("original_days_to_diagnosis") & hsd.original_days_to_diagnosis; ar.labelElement("absoluteDuration" ) & hsd.absoluteDuration; ar.labelElement("negative_diagnosis_event" ) & hsd.negative_diagnosis_event; }
void DiagnosticTreatNeg::serialize(IArchive& ar, DiagnosticTreatNeg* obj) { SimpleDiagnostic::serialize(ar, obj); DiagnosticTreatNeg& diagnostic = *obj; ar.labelElement("negative_diagnosis_config") & diagnostic.negative_diagnosis_config; ar.labelElement("negative_diagnosis_event") & diagnostic.negative_diagnosis_event; ar.labelElement("defaulters_config") & diagnostic.defaulters_config; ar.labelElement("defaulters_event") & diagnostic.defaulters_event; ar.labelElement("m_gets_positive_test_intervention") & diagnostic.m_gets_positive_test_intervention; }
void HIVDelayedIntervention::serialize(IArchive& ar, HIVDelayedIntervention* obj) { DelayedIntervention::serialize( ar, obj ); HIVDelayedIntervention& delayed = *obj; ar.labelElement("year2DelayMap" ) & delayed.year2DelayMap; ar.labelElement("days_remaining" ) & delayed.days_remaining; ar.labelElement("broadcast_event" ) & delayed.broadcast_event; ar.labelElement("broadcast_on_expiration_event" ) & delayed.broadcast_on_expiration_event; }
void WaningEffectMapAbstract::serialize( IArchive& ar, WaningEffectMapAbstract* obj ) { WaningEffectMapAbstract& effect = *obj; ar.labelElement( "m_Expired" ) & effect.m_Expired; ar.labelElement( "m_EffectOriginal" ) & effect.m_EffectOriginal; ar.labelElement( "m_EffectCurrent" ) & effect.m_EffectCurrent; ar.labelElement( "m_ExpireAtDurationMapEnd" ) & effect.m_ExpireAtDurationMapEnd; ar.labelElement( "m_TimeSinceStart" ) & effect.m_TimeSinceStart; ar.labelElement( "m_DurationMap" ) & effect.m_DurationMap; }
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // !!! In a scenario like 25_Madagascar that has 30000+ nodes, // !!! we really have to minimize the data that is being shared // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! void NodeInfo::serialize( IArchive& ar, bool firstTime ) { if( firstTime ) { ar.labelElement("m_Suid" ) & m_Suid.data; ar.labelElement("m_ExternalId" ) & m_ExternalId; ar.labelElement("m_Rank" ) & m_Rank; ar.labelElement("m_LongitudeDegrees" ) & m_LongitudeDegrees; ar.labelElement("m_LatitudeDegrees" ) & m_LatitudeDegrees; } ar.labelElement("m_Population" ) & m_Population; }
void serialize(IArchive& ar, pfemp1_antibody_t& antibodies) { ar.startObject(); ar.labelElement("minor") & antibodies.minor; ar.labelElement("major") & antibodies.major; ar.endObject(); }
void MultiEffectBoosterVaccine::serialize(IArchive& ar, MultiEffectBoosterVaccine* obj) { MultiEffectVaccine::serialize( ar, obj ); MultiEffectBoosterVaccine& vaccine = *obj; ar.labelElement("prime_acquire") & vaccine.prime_acquire; ar.labelElement("prime_transmit") & vaccine.prime_transmit; ar.labelElement("prime_mortality") & vaccine.prime_mortality; ar.labelElement("boost_acquire") & vaccine.boost_acquire; ar.labelElement("boost_transmit") & vaccine.boost_transmit; ar.labelElement("boost_mortality") & vaccine.boost_mortality; ar.labelElement("boost_threshold_acquire") & vaccine.boost_threshold_acquire; ar.labelElement("boost_threshold_transmit") & vaccine.boost_threshold_transmit; ar.labelElement("boost_threshold_mortality") & vaccine.boost_threshold_mortality; }
void PairFormationStatsImpl::serialize(IArchive& ar, PairFormationStatsImpl* obj) { PairFormationStatsImpl& stats = *obj; ar.labelElement("eligible_population") & stats.eligible_population; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // !!! Needs to be set during serialization //const IPairFormationParameters* parameters; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! }
void Infection::serialize(IArchive& ar, Infection* obj) { Infection& infection = *obj; ar.labelElement("suid") & infection.suid; ar.labelElement("duration") & infection.duration; ar.labelElement("total_duration") & infection.total_duration; ar.labelElement("incubation_timer") & infection.incubation_timer; ar.labelElement("infectious_timer") & infection.infectious_timer; ar.labelElement("infectiousness") & infection.infectiousness; ar.labelElement("infectiousnessByRoute") & infection.infectiousnessByRoute; ar.labelElement("StateChange") & (uint32_t&)infection.StateChange; ar.labelElement( "infection_strain" ); StrainIdentity::serialize( ar, infection.infection_strain ); }
void VectorCohortIndividual::serialize(IArchive& ar, VectorCohortIndividual* obj) { VectorCohortAbstract::serialize(ar, obj); VectorCohortIndividual& cohort = *obj; //ar.labelElement("m_ID" ) & cohort.m_ID; ar.labelElement("additional_mortality" ) & cohort.additional_mortality; ar.labelElement("oviposition_timer" ) & cohort.oviposition_timer; ar.labelElement("parity" ) & cohort.parity; ar.labelElement("neweggs" ) & cohort.neweggs; /* TODO - this 'has_strain' stuff is left over from when m_strain could be a nullptr. */ bool has_strain = true; ar.labelElement("__has_strain__"); ar & has_strain; // clorton TODO - perhaps the cohort should always have a non-null m_strain, just use a dummy StrainIdentity when there's no infection. if (has_strain) { ar.labelElement("m_strain"); StrainIdentity::serialize(ar, cohort.m_strain); } }
void PropertyValueChanger::serialize(IArchive& ar, PropertyValueChanger* obj) { BaseIntervention::serialize( ar, obj ); PropertyValueChanger& changer = *obj; ar.labelElement("target_property_key" ) & changer.target_property_key; ar.labelElement("target_property_value") & changer.target_property_value; ar.labelElement("probability" ) & changer.probability; ar.labelElement("revert" ) & changer.revert; ar.labelElement("max_duration" ) & changer.max_duration; ar.labelElement("action_timer" ) & changer.action_timer; ar.labelElement("reversion_timer" ) & changer.reversion_timer; if( !ar.IsWriter() ) { changer.target_property_key.constraints = IPKey::GetConstrainedStringConstraintKey(); changer.target_property_value.constraints = IPKey::GetConstrainedStringConstraintValue(); //TODO - Need to actual use the constrained string } }
void PropertyValueChanger::serialize(IArchive& ar, PropertyValueChanger* obj) { BaseIntervention::serialize( ar, obj ); PropertyValueChanger& changer = *obj; ar.labelElement("target_property_key" ) & changer.target_property_key; ar.labelElement("target_property_value") & changer.target_property_value; ar.labelElement("probability" ) & changer.probability; ar.labelElement("revert" ) & changer.revert; ar.labelElement("max_duration" ) & changer.max_duration; ar.labelElement("action_timer" ) & changer.action_timer; ar.labelElement("reversion_timer" ) & changer.reversion_timer; if( !ar.IsWriter() ) { changer.target_property_key.constraints = "<demographics>::Defaults.Individual_Properties.*.Property.<keys>"; changer.target_property_value.constraints = "<demographics>::Defaults.Individual_Properties.*.Value.<keys>"; //TODO - Need to actual use the constrained string } }
void IndividualHumanMalaria::serialize(IArchive& ar, IndividualHumanMalaria* obj) { IndividualHumanVector::serialize(ar, obj); IndividualHumanMalaria& individual = *obj; ar.labelElement("m_inv_microliters_blood") & individual.m_inv_microliters_blood; ar.labelElement("m_male_gametocytes") & individual.m_male_gametocytes; ar.labelElement("m_female_gametocytes") & individual.m_female_gametocytes; ar.labelElement("m_male_gametocytes_by_strain"); Kernel::serialize(ar, individual.m_male_gametocytes_by_strain); ar.labelElement("m_female_gametocytes_by_strain"); Kernel::serialize(ar, individual.m_female_gametocytes_by_strain); ar.labelElement("m_parasites_detected_by_blood_smear") & individual.m_parasites_detected_by_blood_smear; ar.labelElement("m_parasites_detected_by_new_diagnostic") & individual.m_parasites_detected_by_new_diagnostic; ar.labelElement("m_gametocytes_detected") & individual.m_gametocytes_detected; ar.labelElement("m_clinical_symptoms"); ar.serialize( individual.m_clinical_symptoms, ClinicalSymptomsEnum::CLINICAL_SYMPTOMS_COUNT); ar.labelElement("m_initial_infected_hepatocytes") & individual.m_initial_infected_hepatocytes; // ---------------------------------------------------------------------- // --- This is a pointer to an object held in the Susceptibility object. // --- It will be re-set after de-serialization. See SetContextTo() // ---------------------------------------------------------------------- //ar.labelElement("m_CSP_antibody") & individual.m_CSP_antibody; // ---------------------------------------------------------------------- }
void DiagnosticTreatNeg::serialize(IArchive& ar, DiagnosticTreatNeg* obj) { SimpleDiagnostic::serialize(ar, obj); DiagnosticTreatNeg& diagnostic = *obj; ar.labelElement("negative_diagnosis_config") & diagnostic.negative_diagnosis_config; // Remove after testing (implemented above) // clorton if ( ar.IsWriter() ) // clorton { // clorton std::ostringstream string_stream; // clorton json::Writer::Write( diagnostic.negative_diagnosis_config._json, string_stream ); // clorton ar & string_stream.str(); // clorton } // clorton else // clorton { // clorton std::string json; // clorton ar & json; // clorton std::istringstream string_stream( json ); // clorton json::Reader::Read( diagnostic.negative_diagnosis_config._json, string_stream ); // clorton } ar.labelElement("negative_diagnosis_event") & diagnostic.negative_diagnosis_event; ar.labelElement("defaulters_config") & diagnostic.defaulters_config; // Remove after testing (implemented above) // clorton if ( ar.IsWriter() ) // clorton { // clorton std::ostringstream string_stream; // clorton json::Writer::Write( diagnostic.defaulters_config._json, string_stream ); // clorton ar & string_stream.str(); // clorton } // clorton else // clorton { // clorton std::string json; // clorton ar & json; // clorton std::istringstream string_stream( json ); // clorton json::Reader::Read( diagnostic.defaulters_config._json, string_stream ); // clorton } ar.labelElement("defaulters_event") & diagnostic.defaulters_event; ar.labelElement("m_gets_positive_test_intervention") & diagnostic.m_gets_positive_test_intervention; }
void FlowControllerImpl::serialize(IArchive& ar, FlowControllerImpl* obj) { FlowControllerImpl& flow = *obj; ar.labelElement("rate_ratio" ); ar.serialize( flow.rate_ratio, Gender::COUNT ); ar.labelElement("desired_flow" ) & flow.desired_flow; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // !!! Needs to be set during serialization //IPairFormationAgent* pair_formation_agent; //IPairFormationStats* pair_formation_stats; //IPairFormationRateTable* rate_table; //const IPairFormationParameters* parameters; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! }
void PairFormationParametersImpl::serialize(IArchive& ar, PairFormationParametersImpl* obj) { PairFormationParametersImpl& parameters = *obj; ar.labelElement("rel_type" ) & (uint32_t&)parameters.rel_type; ar.labelElement("male_age_bin_count" ) & parameters.male_age_bin_count; ar.labelElement("initial_male_age" ) & parameters.initial_male_age; ar.labelElement("male_age_increment" ) & parameters.male_age_increment; ar.labelElement("female_age_bin_count" ) & parameters.female_age_bin_count; ar.labelElement("initial_female_age" ) & parameters.initial_female_age; ar.labelElement("female_age_increment" ) & parameters.female_age_increment; ar.labelElement("rate_ratio" ); ar.serialize( parameters.rate_ratio, Gender::COUNT ); ar.labelElement("age_bins" ) & parameters.age_bins; ar.labelElement("joint_probabilities" ) & parameters.joint_probabilities; ar.labelElement("cumulative_joint_probabilities") & parameters.cumulative_joint_probabilities; ar.labelElement("marginal_values" ) & parameters.marginal_values; ar.labelElement("update_period" ) & parameters.update_period; ar.labelElement("formation_rate_type" ) & (uint32_t&)parameters.formation_rate_type; ar.labelElement("formation_rate_constant" ) & parameters.formation_rate_constant; ar.labelElement("formation_rate_sigmoid" ) & parameters.formation_rate_sigmoid; ar.labelElement("formation_rate_value_map" ) & (std::map<float,float>&)parameters.formation_rate_value_map; }
void MalariaAntibody::serialize(IArchive& ar, MalariaAntibody* obj) { MalariaAntibody& antibody = *obj; ar.labelElement("m_antibody_capacity") & antibody.m_antibody_capacity; ar.labelElement("m_antibody_concentration") & antibody.m_antibody_concentration; ar.labelElement("m_antigen_count") & antibody.m_antigen_count; ar.labelElement("m_antigen_present") & antibody.m_antigen_present; ar.labelElement("m_antibody_type") & (uint32_t&)antibody.m_antibody_type; ar.labelElement("m_antibody_variant") & antibody.m_antibody_variant; }
void Susceptibility::serialize(IArchive& ar, Susceptibility* obj) { Susceptibility& susceptibility = *obj; ar.labelElement("age") & susceptibility.age; ar.labelElement("mod_acquire") & susceptibility.mod_acquire; ar.labelElement("mod_transmit") & susceptibility.mod_transmit; ar.labelElement("mod_mortality") & susceptibility.mod_mortality; ar.labelElement("acqdecayoffset") & susceptibility.acqdecayoffset; ar.labelElement("trandecayoffset") & susceptibility.trandecayoffset; ar.labelElement("mortdecayoffset") & susceptibility.mortdecayoffset; ar.labelElement("immune_failage") & susceptibility.immune_failage; }
void SusceptibilityAirborne::serialize(IArchive& ar, SusceptibilityAirborne* obj) { Susceptibility::serialize(ar, obj); SusceptibilityAirborne& susceptibility = *obj; ar.labelElement("demographic_risk") & susceptibility.demographic_risk; }
void WaningEffectExponential::serialize(IArchive& ar, WaningEffectExponential* obj) { WaningEffectExponential& effect = *obj; ar.labelElement("currentEffect") & effect.currentEffect; ar.labelElement("decayTimeConstant") & effect.decayTimeConstant; }
void SimpleBednet::serialize(IArchive& ar, SimpleBednet* obj) { AbstractBednet::serialize( ar, obj ); SimpleBednet& bednet = *obj; ar.labelElement("m_pEffectUsage") & bednet.m_pEffectUsage; }
void HIVInterventionsContainer::serialize(IArchive& ar, HIVInterventionsContainer* obj) { STIInterventionsContainer::serialize( ar, obj ); HIVInterventionsContainer& container = *obj; ar.labelElement("HIV_drug_inactivation_rate" ) & container.HIV_drug_inactivation_rate; ar.labelElement("HIV_drug_clearance_rate" ) & container.HIV_drug_clearance_rate; ar.labelElement("ART_status" ) & (uint32_t&)container.ART_status; ar.labelElement("full_suppression_timer" ) & container.full_suppression_timer; ar.labelElement("days_to_achieve_suppression" ) & container.days_to_achieve_suppression; ar.labelElement("days_since_most_recent_ART_start" ) & container.days_since_most_recent_ART_start; ar.labelElement("m_suppression_failure_timer" ) & container.m_suppression_failure_timer; ar.labelElement("maternal_transmission_suppression") & container.maternal_transmission_suppression; ar.labelElement("campaign_semaphores" ) & container.campaign_semaphores; ar.labelElement("on_PreART" ) & container.on_PreART; ar.labelElement("ever_tested_HIV_positive" ) & container.ever_tested_HIV_positive; ar.labelElement("ever_tested" ) & container.ever_tested; ar.labelElement("ever_received_CD4" ) & container.ever_received_CD4; ar.labelElement("ever_staged_for_ART" ) & container.ever_staged_for_ART; ar.labelElement("ever_staged" ) & container.ever_staged; ar.labelElement("ever_been_on_PreART" ) & container.ever_been_on_PreART; ar.labelElement("ever_been_on_ART" ) & container.ever_been_on_ART; ar.labelElement("time_of_most_recent_test" ) & container.time_of_most_recent_test; ar.labelElement("time_of_most_recent_CD4" ) & container.time_of_most_recent_CD4; ar.labelElement("time_last_seen_by_healthcare" ) & container.time_last_seen_by_healthcare; ar.labelElement("time_first_started_ART" ) & container.time_first_started_ART; ar.labelElement("time_last_started_ART" ) & container.time_last_started_ART; ar.labelElement("total_time_on_ART" ) & container.total_time_on_ART; ar.labelElement("last_recorded_WHO_stage" ) & container.last_recorded_WHO_stage; ar.labelElement("lowest_recorded_CD4" ) & container.lowest_recorded_CD4; ar.labelElement("first_recorded_CD4" ) & container.first_recorded_CD4; ar.labelElement("last_recorded_CD4" ) & container.last_recorded_CD4; ar.labelElement("num_times_started_ART" ) & container.num_times_started_ART; ar.labelElement("received_HIV_test_results" ) & (uint32_t&)container.received_HIV_test_results; //hiv_parent set in SetContextTo }