当前位置: 首页>>代码示例>>C++>>正文


C++ DataContainer::buildUberPOOLTrips方法代码示例

本文整理汇总了C++中DataContainer::buildUberPOOLTrips方法的典型用法代码示例。如果您正苦于以下问题:C++ DataContainer::buildUberPOOLTrips方法的具体用法?C++ DataContainer::buildUberPOOLTrips怎么用?C++ DataContainer::buildUberPOOLTrips使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataContainer的用法示例。


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

示例1: DataContainer

DataContainer * ModelRunner::constructDataContainer(double optInRate, int batchWindowLengthInSec) {
    
    DataContainer * pDataContainer = NULL;
    
    /* 
     * STEP 1: read parse CSV input 
    */
//    pDataContainer = new DataContainer(pDataInput->_inputPath, pDataInput->_cvsFilename, pDataInput->_timelineStr, optInRate, pDataInput->_simLengthInMinutes, pDataOutput->_printDebugFiles, pDataOutput->_printToScreen, pGeofence);
    pDataContainer = new DataContainer(pDataInput->_inputCvsFile, pDataInput->_timelineStr, optInRate, pDataInput->_simLengthInMinutes, pDataOutput->_printDebugFiles, pDataOutput->_printToScreen, pGeofence);
    pDataContainer->setBatchWindowInSeconds(batchWindowLengthInSec);
    try {
        pDataContainer->extractCvsSnapshot();  
    } catch( FileNotFoundException &ex ) {
        std::cerr << "\n*** FileNotFoundException thrown ***" << std::endl;
        std::cerr << ex.what() << std::endl;
        std::cerr << "\t(exiting unsuccessfully) " << std::endl;
        exit(1);
    }

    /*
     *  step 2: filter uberX users to proxy for uberPOOL trips
     */
    pDataContainer->generateUberPoolTripProxy();   // get uberPOOL users
    int nPoolTrips = pDataContainer->buildUberPOOLTrips(); // build only uberPOOL trips (subset of all trips which also contain uberX trips)  
    std::cout << Utility::intToStr(nPoolTrips) << " uberPOOL trips created" << std::endl;
              
    /*
     *   step 3: convert Trip objects into:
     *      (i)  Request objects (i.e. Trips that have not yet been dispatched)
     *      (ii) Dispatch objects (i.e. Driver-Rider pairs that have been dispatched)
     */
    pDataContainer->populateRequestsAndTrips();
    _initRequests = pDataContainer->getInitPoolRequestsAtTimeline();
    _allRequestsInSim = pDataContainer->getAllPoolRequestsInSim();
    _initOpenTrips = pDataContainer->getInitOpenTripsAtTimeline();

    return pDataContainer;
}
开发者ID:SGTRANSPORTER,项目名称:uberPOOLMatchOpt,代码行数:38,代码来源:ModelRunner.cpp


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