Factor out a computation that could potetially change
authorChristos KK Loverdos <loverdos@gmail.com>
Tue, 28 Feb 2012 11:22:56 +0000 (13:22 +0200)
committerChristos KK Loverdos <loverdos@gmail.com>
Tue, 28 Feb 2012 11:22:56 +0000 (13:22 +0200)
src/main/scala/gr/grnet/aquarium/logic/accounting/Accounting.scala

index 56c966a..1a49daf 100644 (file)
@@ -106,9 +106,7 @@ trait Accounting extends DSLUtils with Loggable {
     }
 
     // 1. Round ONE: split time according to overlapping policies and agreements.
-    val alignedPolicyTimeslots    = referenceTimeslot.align(policyTimeslots.toList)
-    val alignedAgreementTimeslots = referenceTimeslot.align(agreementTimeslots.toList)
-    val alignedTimeslots  = alignTimeslots(alignedPolicyTimeslots, alignedAgreementTimeslots)
+    val alignedTimeslots = splitTimeslotByPoliciesAndAgreements(referenceTimeslot, policyTimeslots.toList, agreementTimeslots.toList)
 
     // 2. Round TWO: Use the aligned timeslots of Round ONE to produce even more
     //    fine-grained timeslots according to applicable algorithms.