Beispiel #1
0
// ===========================================================================
// member method definitions
// ===========================================================================
MSVehicleControl::MSVehicleControl() :
    myLoadedVehNo(0),
    myRunningVehNo(0),
    myEndedVehNo(0),
    myDiscarded(0),
    myCollisions(0),
    myTeleportsJam(0),
    myTeleportsYield(0),
    myTeleportsWrongLane(0),
    myEmergencyStops(0),
    myTotalDepartureDelay(0),
    myTotalTravelTime(0),
    myDefaultVTypeMayBeDeleted(true),
    myDefaultPedTypeMayBeDeleted(true),
    myDefaultBikeTypeMayBeDeleted(true),
    myWaitingForPerson(0),
    myWaitingForContainer(0),
    myMaxSpeedFactor(1),
    myMinDeceleration(SUMOVTypeParameter::getDefaultDecel(SVC_IGNORING)),
    myPendingRemovals(MSGlobals::gNumSimThreads > 1) {
    SUMOVTypeParameter defType(DEFAULT_VTYPE_ID, SVC_PASSENGER);
    myVTypeDict[DEFAULT_VTYPE_ID] = MSVehicleType::build(defType);
    SUMOVTypeParameter defPedType(DEFAULT_PEDTYPE_ID, SVC_PEDESTRIAN);
    defPedType.parametersSet |= VTYPEPARS_VEHICLECLASS_SET;
    myVTypeDict[DEFAULT_PEDTYPE_ID] = MSVehicleType::build(defPedType);
    SUMOVTypeParameter defBikeType(DEFAULT_BIKETYPE_ID, SVC_BICYCLE);
    defBikeType.parametersSet |= VTYPEPARS_VEHICLECLASS_SET;
    myVTypeDict[DEFAULT_BIKETYPE_ID] = MSVehicleType::build(defBikeType);
    OptionsCont& oc = OptionsCont::getOptions();
    myScale = oc.getFloat("scale");
}
Beispiel #2
0
// ===========================================================================
// member method definitions
// ===========================================================================
MSVehicleControl::MSVehicleControl() :
    myLoadedVehNo(0),
    myRunningVehNo(0),
    myEndedVehNo(0),
    myDiscarded(0),
    myCollisions(0),
    myTeleportsJam(0),
    myTeleportsYield(0),
    myTeleportsWrongLane(0),
    myEmergencyStops(0),
    myTotalDepartureDelay(0),
    myTotalTravelTime(0),
    myDefaultVTypeMayBeDeleted(true),
    myDefaultPedTypeMayBeDeleted(true),
    myWaitingForPerson(0),
    myWaitingForContainer(0),
    myScale(-1),
    myMaxSpeedFactor(1),
    myMinDeceleration(SUMOVTypeParameter::getDefaultDecel(SVC_IGNORING)) {
    SUMOVTypeParameter defType(DEFAULT_VTYPE_ID, SVC_PASSENGER);
    myVTypeDict[DEFAULT_VTYPE_ID] = MSVehicleType::build(defType);
    SUMOVTypeParameter defPedType(DEFAULT_PEDTYPE_ID, SVC_PEDESTRIAN);
    defPedType.setParameter |= VTYPEPARS_VEHICLECLASS_SET;
    myVTypeDict[DEFAULT_PEDTYPE_ID] = MSVehicleType::build(defPedType);
    OptionsCont& oc = OptionsCont::getOptions();
    if (oc.isSet("scale")) {
        myScale = oc.getFloat("scale");
    }
    myMaxRandomDepartOffset = string2time(oc.getString("random-depart-offset"));
}
Beispiel #3
0
// ===========================================================================
// member method definitions
// ===========================================================================
MSVehicleControl::MSVehicleControl() :
    myLoadedVehNo(0),
    myRunningVehNo(0),
    myEndedVehNo(0),
    myDiscarded(0),
    myCollisions(0),
    myTeleportsJam(0),
    myTeleportsYield(0),
    myTeleportsWrongLane(0),
    myTotalDepartureDelay(0),
    myTotalTravelTime(0),
    myDefaultVTypeMayBeDeleted(true),
    myWaitingForPerson(0),
    myScale(-1) {
    SUMOVTypeParameter defType(DEFAULT_VTYPE_ID, SVC_IGNORING);
    myVTypeDict[DEFAULT_VTYPE_ID] = MSVehicleType::build(defType);
    OptionsCont& oc = OptionsCont::getOptions();
    if (oc.isSet("scale")) {
        myScale = oc.getFloat("scale");
    }
}
// ===========================================================================
// member method definitions
// ===========================================================================
MSVehicleControl::MSVehicleControl
 (bool ecoGemRouterFlag)
 :myLoadedVehNo(0), myRunningVehNo(0), myEndedVehNo(0),
  myTotalDepartureDelay(0), myTotalTravelTime(0),
  myDefaultVTypeMayBeDeleted(true), myWaitingForPerson(0)
{
  /* This is the function which is calling MSVehicleType::build */
  if(OptionsCont::getOptions().getInt("simulationVerbosity")>1)
    std::cout<<"----> MSVehicleControl::MSVehicleControl(bool ecoGemRouterFlag="
     <<ecoGemRouterFlag<<")"<<std::endl;
  if(OptionsCont::getOptions().getInt("simulationVerbosity")>1)     
    std::cout<<"[050] MSVehicleControl::MSVehicleControl(bool ecoGemRouterFlag="
     <<ecoGemRouterFlag<<")\n (will now execute... SUMOVTypeParameter defType(D"
     <<"EFAULT_VTYPE_ID);)"<<std::endl;
  SUMOVTypeParameter defType(DEFAULT_VTYPE_ID);
  myVTypeDict[DEFAULT_VTYPE_ID] = MSVehicleType::build(defType);
  if(OptionsCont::getOptions().getInt("simulationVerbosity")>1)
    std::cout<<"[060] MSVehicleControl::MSVehicleControl(bool ecoGemRouterFlag="
     <<ecoGemRouterFlag<<")\n (will now execute... SUMOVTypeParameter defType(D"
     <<"DEFAULT_ELECVTYPE_ID);)"<<std::endl;
  /* HIB - 2012 Aug 20 (uprego) */
  SUMOVTypeParameter defElecType(DEFAULT_ELECVTYPE_ID);
  myVTypeDict[DEFAULT_ELECVTYPE_ID] = MSVehicleType::build(defElecType);
  /* Catch vehicles to track */
  /* scenload catching */
  if((OptionsCont::getOptions().getInt("buildVerbosity") > 1) ||
       (OptionsCont::getOptions().getInt("simulationVerbosity") > 1))
    std::cout<<"attempting to catch vehicles to track"<<std::endl;
  if(VehicleToTrack::getVehiclesToTrackWithCharacteristicsList() &&
     VehicleToTrack::getVehiclesToTrackWithCharacteristicsList()->size() > 0)
  {
    if((OptionsCont::getOptions().getInt("buildVerbosity") > 1) ||
       (OptionsCont::getOptions().getInt("simulationVerbosity") > 1))
      std::cout<<"catched vehicles to track"<<std::endl;
    
    std::cout<<"VehicleToTrack::getVehiclesToTrackWithCharacteristicsList()->size()="<<VehicleToTrack::getVehiclesToTrackWithCharacteristicsList()->size()<<std::endl;
    for(int i=0; i<VehicleToTrack::getVehiclesToTrackWithCharacteristicsList()->size(); i++)
    {
      /* Create a vtype for each one */
      // ALERT with segfaults
      //const std::string _ = VehicleToTrack::getVehiclesToTrackWithCharacteristicsList().at(i)->getIdentifier(); // TODO ACTIVATE
      //SUMOVTypeParameter customType(_); // TODO ACTIVATE
      /*SUMOVTypeParameter customType(VehicleToTrack::getVehiclesToTrackWithCharacteristicsList().at(i)->getIdentifier());*/
      // ALERT with segfaults
      //myVTypeDict[VehicleToTrack::getVehiclesToTrackWithCharacteristicsList().at(i)->getIdentifier()] = MSVehicleType::build(customType); // TODO ACTIVATE
      /*
      if(VehicleToTrack::getVehiclesToTrackWithCharacteristicsList().at(i)->getIdentifier() == getID())
      {
      */      
        /* TODO PROCESS */
        /*this->getMyType()->getCooperLosses();*/
        ;
      /*
      }
      */
    }
    
  }
  else
  {
    if((OptionsCont::getOptions().getInt("buildVerbosity") > 1) ||
       (OptionsCont::getOptions().getInt("simulationVerbosity") > 1))
      std::cout<<"no vehicles to track catched"<<std::endl;
  }  
  
  ecoGemRouter = ecoGemRouterFlag;
}