Skip to content

Commit

Permalink
SST and speedy pax adjustment related to #512
Browse files Browse the repository at this point in the history
  • Loading branch information
patsonluk committed Oct 11, 2022
1 parent bfe5c40 commit 06ce6a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,10 @@ case class SpeedPreference(homeAirport : Airport, preferredLinkClass: LinkClass)
override val loyaltySensitivity = 0
override val frequencyThreshold = 14
override val frequencySensitivity = 0.15
override val flightDurationSensitivity = 1.3
override val flightDurationSensitivity = 1.0

def computeCost(baseCost : Double, link : Transport, linkClass : LinkClass) = {
val noise = 0.9 + getFlatTopBellRandom(0.2, 0.1)
val noise = 0.9 + getFlatTopBellRandom(0.3, 0.25)

//NOISE?
val finalCost = baseCost * noise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1147,15 +1147,15 @@ class PassengerSimulationSpec(_system: ActorSystem) extends TestKit(_system) wit
assert(totalAcceptedRoutes / totalRoutes.toDouble < 0.25)
}

"accept some links at 3 x suggested price with neutral quality and decent loyalty for SUPERSONIC flight of Speedy Eco pax".in {
"accept some links at 2 x suggested price with neutral quality and decent loyalty for SUPERSONIC flight of Speedy Eco pax".in {
val clonedFromAirport = fromAirport.copy()
clonedFromAirport.initAirlineAppeals(Map(testAirline1.id -> AirlineAppeal(loyalty = 50, 0)))

val toAirport = toAirportsList(2)
val distance = Util.calculateDistance(clonedFromAirport.latitude, clonedFromAirport.longitude, toAirport.latitude, toAirport.longitude).intValue()
val duration = Computation.calculateDuration(2000, distance)
val suggestedPrice = Pricing.computeStandardPriceForAllClass(distance, clonedFromAirport, toAirport)
val price = suggestedPrice * 3
val price = suggestedPrice * 2
val linkType = Computation.getFlightType(fromAirport, toAirport, distance)
val quality = fromAirport.expectedQuality(linkType, ECONOMY)
val newLink = Link(clonedFromAirport, toAirport, testAirline1, price = price, distance = distance, LinkClassValues.getInstance(10000, 10000, 10000), rawQuality = quality, duration, frequency = Link.HIGH_FREQUENCY_THRESHOLD, linkType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -862,8 +862,8 @@ class FlightPreferenceSpec(_system: ActorSystem) extends TestKit(_system) with I
}

val ratio = airline1Picked.toDouble / airline2Picked
assert(ratio > 1)
assert(ratio < 2)
assert(ratio > 1.5)
assert(ratio < 2.5)
}
}
}

0 comments on commit 06ce6a9

Please sign in to comment.