Skip to content

Commit

Permalink
Warehouse activity name changed to Home in order to get Beam works co…
Browse files Browse the repository at this point in the history
…rrectly with tours
  • Loading branch information
dimaopen committed Apr 7, 2022
1 parent c05b00f commit 2059ebf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/R/freight/freight-processing.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ events <- readCsv(pp(workDir, "/5.events.csv.gz"))
unloading <- events[actType=="Unloading"]
nrow(unloading[type=="actstart"])
nrow(unloading[type=="actend"])
warehouse <- events[actType=="Warehouse"]
warehouse <- events[actType=="Home"]
nrow(warehouse[type=="actstart"])
nrow(warehouse[type=="actend"])
pt <- events[type=="PathTraversal"][,c("time","type","vehicleType","vehicle","secondaryFuelLevel",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ trait FreightReader {
): Plan = {
val allToursPlanElements = tours.flatMap { tour =>
val tourInitialActivity =
createFreightActivity("Warehouse", tour.warehouseLocationUTM, tour.departureTimeInSec, None)
createFreightActivity("Home", tour.warehouseLocationUTM, tour.departureTimeInSec, None)
val firstLeg: Leg = createFreightLeg(tour.departureTimeInSec)

val plans: IndexedSeq[PayloadPlan] = plansPerTour.get(tour.tourId) match {
Expand All @@ -82,7 +82,7 @@ trait FreightReader {
elements
}

val finalActivity = createFreightActivity("Warehouse", tours.head.warehouseLocationUTM, -1, None)
val finalActivity = createFreightActivity("Home", tours.head.warehouseLocationUTM, -1, None)
val allPlanElements: IndexedSeq[PlanElement] = allToursPlanElements :+ finalActivity

val currentPlan = PopulationUtils.createPlan(person)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ class FreightReplannerSpec extends AnyWordSpecLike with Matchers with BeamHelper
plan.getPlanElements should have size 9
plan.getPlanElements.get(0) shouldBe a[Activity]
val activity0 = plan.getPlanElements.get(0).asInstanceOf[Activity]
activity0.getType should be("Warehouse")
activity0.getType should be("Home")
activity0.getEndTime should be(11915.0)
plan.getPlanElements.get(2).asInstanceOf[Activity].getType should be("Unloading")
plan.getPlanElements.get(4).asInstanceOf[Activity].getType should be("Unloading")
plan.getPlanElements.get(6).asInstanceOf[Activity].getType should be("Loading")
plan.getPlanElements.get(8).asInstanceOf[Activity].getType should be("Warehouse")
plan.getPlanElements.get(8).asInstanceOf[Activity].getType should be("Home")
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class GenericFreightReaderSpec extends AnyWordSpecLike with Matchers {
plan4.getPlanElements.get(2).asInstanceOf[Activity].getCoord should be(
new Coord(169900.11498160253, 3510.2356380579545)
)
plan4.getPlanElements.get(4).asInstanceOf[Activity].getType should be("Warehouse")
plan4.getPlanElements.get(4).asInstanceOf[Activity].getType should be("Home")
}
}

Expand Down

0 comments on commit 2059ebf

Please sign in to comment.