time longest
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
|||||||
"cloud.o-forge.io/core/oc-lib/tools"
|
"cloud.o-forge.io/core/oc-lib/tools"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
func GetPlannerNearestStart(start time.Time, planned map[tools.DataType]map[string]pricing.PricedItemITF) float64 {
|
func GetPlannerNearestStart(start time.Time, planned map[tools.DataType]map[string]pricing.PricedItemITF) float64 {
|
||||||
near := float64(-1) // unset sentinel
|
near := float64(-1) // unset sentinel
|
||||||
for _, items := range planned { // loop through the planned items
|
for _, items := range planned { // loop through the planned items
|
||||||
@@ -27,10 +28,7 @@ func GetPlannerNearestStart(start time.Time, planned map[tools.DataType]map[stri
|
|||||||
return near
|
return near
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetPlannerLongestTime(end *time.Time, planned map[tools.DataType]map[string]pricing.PricedItemITF) float64 {
|
func GetPlannerLongestTime(planned map[tools.DataType]map[string]pricing.PricedItemITF) float64 {
|
||||||
if end == nil {
|
|
||||||
return -1
|
|
||||||
}
|
|
||||||
longestTime := float64(0)
|
longestTime := float64(0)
|
||||||
for _, priced := range planned[tools.PROCESSING_RESOURCE] {
|
for _, priced := range planned[tools.PROCESSING_RESOURCE] {
|
||||||
longestTime += priced.GetExplicitDurationInS()
|
longestTime += priced.GetExplicitDurationInS()
|
||||||
|
|||||||
@@ -650,7 +650,7 @@ func (wf *Workflow) Planify(start time.Time, end *time.Time, instances ConfigIte
|
|||||||
return false, 0, priceds, nil, err
|
return false, 0, priceds, nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
longest := common.GetPlannerLongestTime(end, priceds)
|
longest := common.GetPlannerLongestTime(priceds)
|
||||||
if _, priceds, err = plan[resources.ResourceInterface](tools.WORKFLOW_RESOURCE, instances, partnerships, buyings, strategies,
|
if _, priceds, err = plan[resources.ResourceInterface](tools.WORKFLOW_RESOURCE, instances, partnerships, buyings, strategies,
|
||||||
bookingMode, wf, priceds, request, wf.Graph.IsWorkflow,
|
bookingMode, wf, priceds, request, wf.Graph.IsWorkflow,
|
||||||
func(res resources.ResourceInterface, priced pricing.PricedItemITF) (time.Time, float64, error) {
|
func(res resources.ResourceInterface, priced pricing.PricedItemITF) (time.Time, float64, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user