• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ LOG_DEBUG_F函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LOG_DEBUG_F函数的典型用法代码示例。如果您正苦于以下问题:C++ LOG_DEBUG_F函数的具体用法?C++ LOG_DEBUG_F怎么用?C++ LOG_DEBUG_F使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了LOG_DEBUG_F函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: QueryInterfaceException

    // todo: lift to HIVIntervention or helper function (repeated in HIVDelayedIntervention)
    bool HIVSimpleDiagnostic::UpdateCascade()
    {
        if( AbortDueToCurrentCascadeState() )
        {
            return false ;
        }

        // is this the first time through?  if so, update the cascade state.
        if (firstUpdate)
        {
            IHIVCascadeOfCare *ihcc = nullptr;
            if ( s_OK != parent->GetInterventionsContext()->QueryInterface(GET_IID(IHIVCascadeOfCare), (void **)&ihcc) )
            {
                throw QueryInterfaceException( __FILE__, __LINE__, __FUNCTION__,
                                               "parent->GetInterventionsContext()",
                                               "IHIVCascadeOfCare",
                                               "IIndividualHumanInterventionsContext" );
            }
            LOG_DEBUG_F( "Setting Cascade State to %s for individual %d.\n", cascadeState.c_str(), parent->GetSuid().data );
            ihcc->setCascadeState(cascadeState);

            original_days_to_diagnosis = days_to_diagnosis;
        }
        return true ;
    }
开发者ID:Bridenbecker,项目名称:EMOD,代码行数:26,代码来源:HIVSimpleDiagnostic.cpp


示例2: LOG_DEBUG_F

    void FlowControllerImpl::UpdateDesiredFlow( const IdmDateTime& rCurrentTime, float dt )
    {
        LOG_DEBUG_F("%s()\n", __FUNCTION__);

        // ----------------------------------------------------------
        // --- Count the total number of people eligible for pairing
        // ----------------------------------------------------------
        float cumulative_base_flow = 0.0f;
        
        for( int risk_group = 0; risk_group < RiskGroup::COUNT; risk_group ++)
        {
            auto& eligible_population = pair_formation_stats->GetEligible((RiskGroup::Enum)risk_group);
            for (auto& entry : eligible_population)
            {
                for (float flow : entry.second)
                {
                    cumulative_base_flow += flow;
                }
            }

            if (LOG_LEVEL(INFO))
            {
                LOG_INFO_F( "%s: eligible population for %s risk group:\n", __FUNCTION__, RiskGroup::pairs::lookup_key(risk_group) );
                for (auto& entry : eligible_population) {
                    cout << "{ " << entry.first << ", [ ";
                    for (int count : entry.second) {
                        cout << count << ' ';
                    }
                    cout << "] }" << endl;
                }
            }
        }

        // ---------------------------------------------------------------------
        // --- Multiply the total number of people eligible times the base rate
        // ---------------------------------------------------------------------
        cumulative_base_flow *= parameters->FormationRate( rCurrentTime, dt );

        if (cumulative_base_flow > 0.0f)
        {
            // -----------------------------------------------------------
            // --- Determine the desired rate for each gender and age bin
            // -----------------------------------------------------------
            for (int sex = Gender::MALE; sex <= Gender::FEMALE; sex++)
            {
                auto& desired = desired_flow.at(sex);       // important, use a reference here so we update desired_flow
                auto& marginal = parameters->MarginalValues().at(sex);   // use a reference here to avoid a copy
                int bin_count = desired.size();
                for (int bin_index = 0; bin_index < bin_count; bin_index++)
                {
                    desired[bin_index] = 0.5f * cumulative_base_flow * marginal[bin_index];
                }
            }
        }
        else
        {
            memset(desired_flow[Gender::MALE].data(), 0, desired_flow[Gender::MALE].size() * sizeof(float));
            memset(desired_flow[Gender::FEMALE].data(), 0, desired_flow[Gender::FEMALE].size() * sizeof(float));
        }
    }
开发者ID:clorton,项目名称:EMOD,代码行数:60,代码来源:FlowControllerImpl.cpp


示例3: LOG_DEBUG_F

    bool
    NodeLevelHealthTriggeredIV::Distribute(
        INodeEventContext *pNodeEventContext,
        IEventCoordinator2 *pEC
    )
    {
        bool was_distributed = BaseNodeIntervention::Distribute(pNodeEventContext, pEC);
        if (was_distributed)
        {
            LOG_DEBUG_F("Distributed Nodelevel health-triggered intervention to NODE: %d\n", pNodeEventContext->GetId().data);

            // QI to register ourself as a NodeLevelHealthTriggeredIV observer
            INodeTriggeredInterventionConsumer * pNTIC = nullptr;
            if (s_OK != pNodeEventContext->QueryInterface(GET_IID(INodeTriggeredInterventionConsumer), (void**)&pNTIC))
            {
                throw QueryInterfaceException(__FILE__, __LINE__, __FUNCTION__, "pNodeEventContext", "INodeTriggeredInterventionConsumer", "INodeEventContext");
            }
            release_assert(pNTIC);
            for (auto &trigger : m_trigger_conditions)
            {
                pNTIC->RegisterNodeEventObserver((IIndividualEventObserver*)this, trigger);
            }
        }
        return was_distributed;
    }
开发者ID:clorton,项目名称:EMOD,代码行数:25,代码来源:NodeLevelHealthTriggeredIV.cpp


示例4: cost_per_unit

 // BaseNodeIntervention
 BaseNodeIntervention::BaseNodeIntervention()
     : cost_per_unit(0.0f)
     , expired(false)
 {
     initSimTypes( 1, "*" );
     LOG_DEBUG_F("New intervention, cost_per_unit = %f\n", cost_per_unit);
 }
开发者ID:Bridenbecker,项目名称:EMOD,代码行数:8,代码来源:Interventions.cpp


示例5: duration_counter

 ImportPressure::ImportPressure() 
     : duration_counter(0)
     , num_imports(0)
 {
     LOG_DEBUG_F( "ctor\n" );
     initSimTypes( 1, "GENERIC_SIM" );
 }
开发者ID:clorton,项目名称:EMOD,代码行数:7,代码来源:ImportPressure.cpp


示例6: LOG_DEBUG_F

    void
    DiagnosticTreatNeg::onPatientDefault()
    {
        LOG_DEBUG_F( "Individual %d got the test but defaulted, receiving Defaulters intervention without waiting for days_to_diagnosis (actually means days_to_intervention) \n", parent->GetSuid().data );

        // Important: Use the instance method to obtain the intervention factory obj instead of static method to cross the DLL boundary
        IGlobalContext *pGC = nullptr;
        const IInterventionFactory* ifobj = nullptr;
        if (s_OK == parent->QueryInterface(GET_IID(IGlobalContext), (void**)&pGC))
        {
            ifobj = pGC->GetInterventionFactory();
        }
        if (!ifobj)
        {
            throw NullPointerException( __FILE__, __LINE__, __FUNCTION__, "parent->GetInterventionFactoryObj()" );
        }


        if( !defaulters_event.IsUninitialized() )
        {
            if( defaulters_event != NO_TRIGGER_STR )
            {
                INodeTriggeredInterventionConsumer* broadcaster = nullptr;

                if (s_OK != parent->GetEventContext()->GetNodeEventContext()->QueryInterface(GET_IID(INodeTriggeredInterventionConsumer), (void**)&broadcaster))

                {

                    throw QueryInterfaceException( __FILE__, __LINE__, __FUNCTION__, "parent->GetEventContext()->GetNodeEventContext()", "INodeTriggeredInterventionConsumer", "INodeEventContext" );
                }
                broadcaster->TriggerNodeEventObserversByString( parent->GetEventContext(), defaulters_event );
            }
        }
        else if( defaulters_config._json.Type() != ElementType::NULL_ELEMENT )
        {
            auto tmp_config = Configuration::CopyFromElement(defaulters_config._json);

            // Distribute the defaulters intervention, right away (do not use the days_to_diagnosis
            IDistributableIntervention *di = const_cast<IInterventionFactory*>(ifobj)->CreateIntervention( tmp_config );

            delete tmp_config;
            tmp_config = nullptr;

            ICampaignCostObserver* pICCO;
            // Now make sure cost of the test-positive intervention is reported back to node
            if (s_OK == parent->GetEventContext()->GetNodeEventContext()->QueryInterface(GET_IID(ICampaignCostObserver), (void**)&pICCO) )
            {
                di->Distribute( parent->GetInterventionsContext(), pICCO );
                pICCO->notifyCampaignEventOccurred( (IBaseIntervention*)di, (IBaseIntervention*)this, parent );
            }
            else
            {
                throw QueryInterfaceException( __FILE__, __LINE__, __FUNCTION__, "parent->GetEventContext()->GetNodeEventContext()", "ICampaignCostObserver", "INodeEventContext" );
            }
        }
        else
        {
            throw GeneralConfigurationException( __FILE__, __LINE__, __FUNCTION__, "neither event or config defined" );
        }
    }
开发者ID:Bridenbecker,项目名称:EMOD,代码行数:60,代码来源:DiagnosticsTreatNeg.cpp


示例7: LOG_DEBUG_F

    void SusceptibilityPy::Initialize(float _age, float _immmod, float _riskmod)
    {
        LOG_DEBUG_F( "Initializing Py immunity object for new individual: id=%lu, age=%f, immunity modifier=%f, risk modifier=%f\n", parent->GetSuid().data, _age, _immmod, _riskmod );
        Susceptibility::Initialize(_age, _immmod, _riskmod);

        // throws exception on error, no return type. 
    }
开发者ID:Bridenbecker,项目名称:EMOD,代码行数:7,代码来源:SusceptibilityPy.cpp


示例8: LOG_DEBUG_F

    void IndividualHumanPy::AcquireNewInfection(StrainIdentity *infstrain, int incubation_period_override )
    {
        LOG_DEBUG_F("AcquireNewInfection: route %d\n", _routeOfInfection);
        IndividualHuman::AcquireNewInfection( infstrain, incubation_period_override );
#ifdef ENABLE_PYTHON_FEVER
        static auto pFunc = PythonSupportPtr->IdmPyInit( PythonSupport::SCRIPT_PYTHON_FEVER.c_str(), "acquire_infection" );
        if( pFunc )
        {
            // pass individual id ONLY
            static PyObject * vars = PyTuple_New(1);

            PyObject* py_existing_id = PyLong_FromLong( GetSuid().data );
            PyTuple_SetItem(vars, 0, py_existing_id );

            //vars = Py_BuildValue( "l", GetSuid().data ); // BuildValue with 1 param seems to give errors
            auto ret = PyObject_CallObject( pFunc, vars );
            if( ret == nullptr )
            {
                PyErr_Print();
                std::stringstream msg;
                msg << "Embedded python code failed: PyObject_CallObject failed in call to 'acquire_infection'.";
                throw Kernel::IllegalOperationException( __FILE__, __LINE__, __FUNCTION__, msg.str().c_str() );
            }
        }
#endif
    }
开发者ID:rbaker-idmod,项目名称:EMOD,代码行数:26,代码来源:IndividualPy.cpp


示例9: LOG_DEBUG_F

 void PairFormationStatsImpl::UpdateEligible( float age_in_days, int sex, RiskGroup::Enum risk_group, int delta )
 {
     LOG_DEBUG_F("%s( %f, %d, %s, %d )\n", __FUNCTION__, age_in_days, sex, RiskGroup::pairs::lookup_key(risk_group), delta);
     int agebin_index = parameters->BinIndexForAgeAndSex(age_in_days, sex);
     release_assert( (eligible_population.at(risk_group).at(sex)[agebin_index] + delta) >= 0 );
     eligible_population.at(risk_group).at(sex)[agebin_index] += delta;
 }
开发者ID:clorton,项目名称:EMOD,代码行数:7,代码来源:PairFormationStatsImpl.cpp


示例10: assert

array_list_t *snp_filter(array_list_t *input_records, array_list_t *failed, variant_stats_t **input_stats, char *filter_name, void *f_args) {
    assert(input_records);
    assert(failed);
    
    array_list_t *passed = array_list_new(input_records->size + 1, 1, COLLECTION_MODE_ASYNCHRONIZED);
    size_t filter_name_len = strlen(filter_name);

    int include_snps = ((snp_filter_args*)f_args)->include_snps;

    LOG_DEBUG_F("snp_filter (preserve SNPs = %d) over %zu records\n", include_snps, input_records->size);
    vcf_record_t *record;
    for (int i = 0; i < input_records->size; i++) {
        record = input_records->items[i];
        if (record->id_len == 1 && strncmp(".", record->id, 1) == 0) {
            if (include_snps) {
                annotate_failed_record(filter_name, filter_name_len, record);
                array_list_insert(record, failed);
            } else {
                array_list_insert(record, passed);
            }
        } else {
            if (include_snps) {
                array_list_insert(record, passed);
            } else {
                annotate_failed_record(filter_name, filter_name_len, record);
                array_list_insert(record, failed);
            }
        }
    }

    return passed;
}
开发者ID:cyenyxe,项目名称:hpg-libs-1,代码行数:32,代码来源:vcf_filters.c


示例11: switch

    float SusceptibilityVector::BitingRiskAgeFactor(float _age)
    {
        float risk = 1.0f;
        switch(SusceptibilityVectorConfig::age_dependent_biting_risk_type)
        {
            case AgeDependentBitingRisk::OFF:
                // risk is independent by age
                break;

            case AgeDependentBitingRisk::LINEAR:
                risk = LinearBitingFunction(_age);
                break;

            case AgeDependentBitingRisk::SURFACE_AREA_DEPENDENT:
                risk = SurfaceAreaBitingFunction(_age);
                break;

            default:
                throw BadEnumInSwitchStatementException( __FILE__, __LINE__, __FUNCTION__, 
                    "age_dependent_biting_risk_type", SusceptibilityVectorConfig::age_dependent_biting_risk_type, 
                    AgeDependentBitingRisk::pairs::lookup_key(SusceptibilityVectorConfig::age_dependent_biting_risk_type) );
        }

        LOG_DEBUG_F("Age-dependent biting-risk = %f for %0.2f-year-old individual.\n", risk, _age/DAYSPERYEAR);
        return risk;
    }
开发者ID:InstituteforDiseaseModeling,项目名称:EMOD,代码行数:26,代码来源:SusceptibilityVector.cpp


示例12: release_assert

    bool CommunityHealthWorkerEventCoordinator::Distribute( IIndividualHumanEventContext* pIHEC )
    {
        release_assert( m_pInterventionIndividual );

        IDistributableIntervention *di = m_pInterventionIndividual->Clone();
        release_assert(di);

        ICampaignCostObserver* p_icco = nullptr;
        if (s_OK != pIHEC->GetNodeEventContext()->QueryInterface(GET_IID(ICampaignCostObserver), (void**)&p_icco))
        {
            throw QueryInterfaceException( __FILE__, __LINE__, __FUNCTION__, "pIHEC->GetNodeEventContext()", "ICampaignCostObserver", "INodeEventContext" );
        }

        di->AddRef();

        bool distributed = di->Distribute( pIHEC->GetInterventionsContext(), p_icco );

        if( distributed )
        {
            LOG_DEBUG_F("Distributed '%s' intervention to individual %d\n", m_InterventionName.c_str(), pIHEC->GetSuid().data );
        }

        di->Release();

        return distributed;
    }
开发者ID:clorton,项目名称:EMOD,代码行数:26,代码来源:CommunityHealthWorkerEventCoordinator.cpp


示例13: IllegalOperationException

    bool
    ReferenceTrackingEventCoordinator::Configure(
        const Configuration * inputJson
    )
    {
        if( !JsonConfigurable::_dryrun &&
#ifdef ENABLE_TYPHOID
            (GET_CONFIGURABLE( SimulationConfig )->sim_type != SimType::TYPHOID_SIM) &&
#endif
            (GET_CONFIGURABLE( SimulationConfig )->sim_type != SimType::STI_SIM) &&
            (GET_CONFIGURABLE( SimulationConfig )->sim_type != SimType::HIV_SIM) )
        {
            throw IllegalOperationException( __FILE__, __LINE__, __FUNCTION__, "ReferenceTrackingEventCoordinator can only be used in STI, HIV, and TYPHOID simulations." );
        }

        float update_period = DAYSPERYEAR;
        initConfigComplexType("Time_Value_Map", &year2ValueMap, RTEC_Time_Value_Map_DESC_TEXT );
        initConfigTypeMap(    "Update_Period",  &update_period, RTEC_Update_Period_DESC_TEXT, 1.0,      10*DAYSPERYEAR, DAYSPERYEAR );
        initConfigTypeMap(    "End_Year",       &end_year,      RTEC_End_Year_DESC_TEXT,      MIN_YEAR, MAX_YEAR,       MAX_YEAR );

        auto ret = StandardInterventionDistributionEventCoordinator::Configure( inputJson );
        num_repetitions = -1; // unlimited
        if( JsonConfigurable::_dryrun == false )
        {
            float dt = GET_CONFIGURABLE(SimulationConfig)->Sim_Tstep;
            tsteps_between_reps = update_period/dt; // this won't be precise, depending on math.
            if( tsteps_between_reps <= 0.0 )
            {
                // don't let this be zero or it will only update one time
                tsteps_between_reps = 1;
            }
        }
        LOG_DEBUG_F( "ReferenceTrackingEventCoordinator configured with update_period = %f, end_year = %f, and tsteps_between_reps (derived) = %d.\n", update_period, end_year, tsteps_between_reps );
        return ret;
    }
开发者ID:clorton,项目名称:EMOD,代码行数:35,代码来源:ReferenceTrackingEventCoordinator.cpp


示例14: associate_samples_and_positions

cp_hashtable* associate_samples_and_positions(vcf_file_t* file) {
    LOG_DEBUG_F("** %zu sample names read\n", file->samples_names->size);
    array_list_t *sample_names = file->samples_names;
    cp_hashtable *sample_ids = cp_hashtable_create(sample_names->size * 2,
                                                   cp_hash_string,
                                                   (cp_compare_fn) strcasecmp
                                                  );
    
    int *index;
    char *name;
    
    for (int i = 0; i < sample_names->size; i++) {
        name = sample_names->items[i];
        index = (int*) malloc (sizeof(int)); *index = i;
        
        if (cp_hashtable_get(sample_ids, name)) {
            LOG_FATAL_F("Sample %s appears more than once. File can not be analyzed.\n", name);
        }
        
        cp_hashtable_put(sample_ids, name, index);
    }
//     char **keys = (char**) cp_hashtable_get_keys(sample_ids);
//     int num_keys = cp_hashtable_count(sample_ids);
//     for (int i = 0; i < num_keys; i++) {
//         printf("%s\t%d\n", keys[i], *((int*) cp_hashtable_get(sample_ids, keys[i])));
//     }
    
    return sample_ids;
}
开发者ID:CharoL,项目名称:hpg-variant,代码行数:29,代码来源:assoc_runner.c


示例15: if

 const ProbabilityNumber
 HIVInterventionsContainer::GetInfectivitySuppression()
 const
 {
     // If not on art, 1.0f, else if ramping up, it's linear from 1.0 to 0.08, else if ramped up, 0.08f;
     ProbabilityNumber ret = 1.0f;
     float multiplier = InfectionHIVConfig::ART_viral_suppression_multiplier ;
     if( ART_status == ARTStatus::ON_ART_BUT_NOT_VL_SUPPRESSED )
     {
         if( days_to_achieve_suppression == 0.0 )
         {
             ret = multiplier;
         }
         else
         {
             float time_since_starting_ART = days_to_achieve_suppression - full_suppression_timer ;
             ret = 1.0f - ( ((1.0f - multiplier)/days_to_achieve_suppression) * (time_since_starting_ART) );
         }
     }
     else if( ART_status == ARTStatus::ON_VL_SUPPRESSED )
     {
         ret = multiplier;
     }
     LOG_DEBUG_F( "Returning viral suppression factor of %f.\n", (float) ret );
     return ret;
 }
开发者ID:clorton,项目名称:EMOD,代码行数:26,代码来源:HIVInterventionsContainer.cpp


示例16: switch

    float NodeLevelHealthTriggeredIVScaleUpSwitch::getDemographicCoverage( ) const
    {
        float demographic_coverage = demographic_restrictions.GetDemographicCoverage();  
        float current_demographic_coverage = demographic_coverage;  

        switch (demographic_coverage_time_profile)
        {
        case ScaleUpProfile::Immediate:
            LOG_DEBUG("ScaleUpProfile is Immediate, don't need to update demographic coverage by time \n");
            current_demographic_coverage = demographic_coverage;
            break;

        case ScaleUpProfile::Linear:
            if (duration <= primary_time_constant) 
            {
                //the increment amount is ((demographic_coverage - initial_demog_coverage)/primary_time_constant) per day
                current_demographic_coverage = initial_demographic_coverage + ( (demographic_coverage - initial_demographic_coverage)/primary_time_constant) * duration;
                LOG_DEBUG_F("ScaleUpProfile is Linear, duration is %f, rate of %f, coverage is %f \n", 
                    duration,
                    ( (demographic_coverage - initial_demographic_coverage)/primary_time_constant), 
                    current_demographic_coverage); 
            }
            else
            {
                current_demographic_coverage = demographic_coverage;
            }
            break;

        default:
            throw NotYetImplementedException( __FILE__, __LINE__, __FUNCTION__, "Only Immediate and Linear supported currently. \n" );
            break;
        }
        return current_demographic_coverage;
    }
开发者ID:clorton,项目名称:EMOD,代码行数:34,代码来源:NodeLevelHealthTriggeredIVScaleUpSwitch.cpp


示例17: LOG_DEBUG_F

    bool
    NodeSetPolygon::Contains(
        INodeEventContext *nec
    )
    {
        LOG_DEBUG_F( "Contains node ID = %d ?\n", nec->GetId().data );
        if( vertices_raw.length() > 0 ) // clear this after parse.
        {
            // haven't parsed raw list yet.
            // Go through list and parse out.
            if( polygon_format == PolygonFormatType::SHAPE )
            {
                parseEmodFormat();
            }
            // don't need else here because enum parser already catches such errors
        }

        if( polygon_format == PolygonFormatType::SHAPE && nec->IsInPolygon( points_array, int(num_points) ) )
        {
            LOG_INFO_F( "Node ID = %d is contained within intervention polygon\n", nec->GetId().data );
            return true;
        }

        LOG_DEBUG("Polygon apparently does not contain this node.\n");

        /*else if( polygon_format == PolygonFormatType::GEOJSON && nec->IsInPolygon( poly ) )
        {
            return true;
        }*/
        return false;
    }
开发者ID:Bridenbecker,项目名称:EMOD,代码行数:31,代码来源:NodeSetPolygon.cpp


示例18: LOG_DEBUG_F

    bool ImportPressure::Configure( const Configuration * inputJson )
    {
        LOG_DEBUG_F( "%s\n", __FUNCTION__ );
        // TODO: specification for rate, seasonality, and age-biting function
        initConfigTypeMap( "Durations",              &durations,              IP_Durations_DESC_TEXT,               0, INT_MAX, 1 );
        initConfigTypeMap( "Daily_Import_Pressures", &daily_import_pressures, IP_Daily_Import_Pressures_DESC_TEXT , 0, FLT_MAX, 0 );

        bool configured = Outbreak::Configure( inputJson );

        if( configured && !JsonConfigurable::_dryrun )
        {
            if( durations.size() != (daily_import_pressures.size()) )
            {
                throw GeneralConfigurationException( __FILE__, __LINE__, __FUNCTION__,
                    "ImportPressure intervention requires Durations must be the same size as Daily_Import_Pressures" );
            }
            if( durations.size() <= 0 )
            {
                throw GeneralConfigurationException( __FILE__, __LINE__, __FUNCTION__,
                    "Empty Durations parameter in ImportPressure intervention." );
            }
            ConstructDistributionCalendar();
        }
        return configured;
    }
开发者ID:clorton,项目名称:EMOD,代码行数:25,代码来源:ImportPressure.cpp


示例19: LOG_DEBUG_F

    bool MultiInterventionEventCoordinator::HasNodeLevelIntervention() const
    {
        bool has_node_level_intervention = false;
        bool has_individual_level_intervention = false;

        const json::Array & interventions_array = json::QuickInterpreter( intervention_config._json ).As<json::Array>();
        LOG_DEBUG_F("interventions array size = %d\n", interventions_array.Size());
        for( int idx = 0; idx < interventions_array.Size(); idx++ )
        {
            const json::Object& actualIntervention = json_cast<const json::Object&>(interventions_array[idx]);
            auto config = Configuration::CopyFromElement( actualIntervention, "campaign" );
            INodeDistributableIntervention *ndi = InterventionFactory::getInstance()->CreateNDIIntervention(config);
            if( ndi != nullptr )
            {
                has_node_level_intervention = true;
                ndi->Release();
            }
            else
            {
                has_individual_level_intervention = true;
            }
            delete config;
            config = nullptr;
        }

        if( has_node_level_intervention && has_individual_level_intervention )
        {
            throw GeneralConfigurationException( __FILE__, __LINE__, __FUNCTION__, "You cannot mix individual and nodel-level interventions." );
        }

        return has_node_level_intervention;
    }
开发者ID:clorton,项目名称:EMOD,代码行数:32,代码来源:MultiInterventionEventCoordinator.cpp


示例20: insert_statement_vcf_query_fields

int insert_statement_vcf_query_fields(void *custom_fields, sqlite3_stmt *stmt, sqlite3 *db) {  
    int rc;
    vcf_query_fields_t *fields = (vcf_query_fields_t *) custom_fields;

    sqlite3_bind_text(stmt, 1, fields->chromosome, strlen(fields->chromosome), SQLITE_STATIC);
    sqlite3_bind_int64(stmt, 2, fields->position);
    sqlite3_bind_text(stmt, 3, fields->allele_ref, strlen(fields->allele_ref), SQLITE_STATIC);
    sqlite3_bind_text(stmt, 4, fields->allele_maf, strlen(fields->allele_maf), SQLITE_STATIC);
    sqlite3_bind_text(stmt, 5, fields->genotype_maf, strlen(fields->genotype_maf), SQLITE_STATIC);
    sqlite3_bind_double(stmt, 6, fields->allele_maf_freq);
    sqlite3_bind_double(stmt, 7, fields->genotype_maf_freq);
    sqlite3_bind_int(stmt, 8, fields->missing_alleles);
    sqlite3_bind_int(stmt, 9, fields->missing_genotypes);
    sqlite3_bind_int(stmt, 10, fields->mendelian_errors);
    sqlite3_bind_int(stmt, 11, fields->is_indel);
    sqlite3_bind_double(stmt, 12, fields->cases_percent_dominant);
    sqlite3_bind_double(stmt, 13, fields->controls_percent_dominant);
    sqlite3_bind_double(stmt, 14, fields->cases_percent_recessive);
    sqlite3_bind_double(stmt, 15, fields->controls_percent_recessive);

    if (rc = sqlite3_step(stmt) != SQLITE_DONE) {
        LOG_DEBUG_F("Stats databases failed: %s (%d)\n", sqlite3_errmsg(db), sqlite3_errcode(db));
    }

    sqlite3_reset(stmt);

    return rc;
}
开发者ID:cyenyxe,项目名称:hpg-libs-1,代码行数:28,代码来源:vcf_db.c



注:本文中的LOG_DEBUG_F函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LOG_DIS函数代码示例发布时间:2022-05-30
下一篇:
C++ LOG_DBG函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap