ie3-institute / MobilitySimulator

Stochastic-based simulator for individual mobility
BSD 3-Clause "New" or "Revised" License
7 stars 0 forks source link

Possibility to stay longer in case of low SOC #110

Open t-ober opened 1 year ago

t-ober commented 1 year ago

Previously we implemented a possibility to stay longer in case of low SOC. This changes the trip times which we don't want for longer trip sequences as this can lead to unexpected result. We might add this if needed later on.

  /* Check if SoC is < 10% at start of trip -> if yes, and EV could charge at its destination, do not depart */
  else if (
    socAtStartOfTrip < SOC_OF_10_PERCENT
    && ev.destinationPoi.nearestChargingStations.nonEmpty
  ) {
    // logger.info(
    s"${ev.getId} has SoC < 10% at planned departure, but EV could charged here. It stays until it can charge..."
    // )
    doNotDepartAndStayLongerAtDestination(
      ev,
      currentTime,
      chargingStations,
      tripProbabilities.firstDepartureOfDay,
      tripProbabilities.lastTripOfDay,
      tripProbabilities.parkingTime
    )
  }
t-ober commented 1 year ago

Removed test:

    "not simulate a new trip and keep charging when SoC < 10 % and charging is available" in {
      TripSimulation.simulateNextTrip(
        givenSimulationStart,
        evLowSoC,
        poisWithSizes,
        chargingHubTownIsPresent = true,
        chargingHubHighwayIsPresent = true,
        chargingStations,
        ioUtils,
        tripProbabilities,
        maxDistance
      ) match {
        case ElectricVehicle(
              simulationStart,
              uuid,
              id,
              evType,
              homePoi,
              workPoi,
              storedEnergy,
              destinationPoi,
              destinationPoiType,
              parkingTimeStart,
              departureTime,
              chargingAtHomePossible,
              chosenChargingStation,
              chargingAtSimona,
              finalDestinationPoi,
              finalDestinationPoiType,
              remainingDistanceAfterChargingHub,
              chargingPricesMemory
            ) =>
          simulationStart shouldBe givenSimulationStart
          uuid shouldBe ev1.getUuid
          id shouldBe "car_1"
          evType shouldBe givenModel
          homePoi shouldBe givenHomePoi
          workPoi shouldBe givenWorkPoi
          storedEnergy shouldBe zero
          chargingAtSimona shouldBe false
          destinationPoi shouldBe supermarket
          parkingTimeStart shouldBe simulationStart.plusMinutes(1)
          departureTime shouldBe simulationStart.plusHours(1).plusMinutes(1)
          chargingAtHomePossible shouldBe true
          chosenChargingStation shouldBe None
          finalDestinationPoi shouldBe None
          remainingDistanceAfterChargingHub shouldBe None
          chargingPricesMemory shouldBe mutable.Queue[Double]()
      }
    }