From e1ac556b3dfcffe6b75d53bd6e30df739037e7c2 Mon Sep 17 00:00:00 2001 From: DanB Date: Sun, 26 Nov 2017 18:36:03 +0100 Subject: [PATCH] Suppliers Static sorting -> Weight sorting --- engine/liblcrs.go | 8 ++++---- utils/consts.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/engine/liblcrs.go b/engine/liblcrs.go index 5f1f76678..582d7b720 100644 --- a/engine/liblcrs.go +++ b/engine/liblcrs.go @@ -27,7 +27,7 @@ import ( // NewSupplierSortDispatcher constructs SupplierSortDispatcher func NewSupplierSortDispatcher(lcrS *LCRService) (ssd SupplierSortDispatcher, err error) { ssd = make(map[string]SuppliersSorting) - ssd[utils.MetaStatic] = new(StaticStrategy) + ssd[utils.MetaWeight] = new(WeightStrategy) ssd[utils.MetaLeastCost] = NewLeastCostStrategy(lcrS) return } @@ -62,11 +62,11 @@ func (lcs *LeastCostStrategy) SortSuppliers(suppls LCRSuppliers) (err error) { return } -// StaticStrategy orders suppliers based on their weight, no cost involved -type StaticStrategy struct { +// WeightStrategy orders suppliers based on their weight, no cost involved +type WeightStrategy struct { } -func (ss *StaticStrategy) SortSuppliers(suppls LCRSuppliers) (err error) { +func (ss *WeightStrategy) SortSuppliers(suppls LCRSuppliers) (err error) { suppls.Sort() return } diff --git a/utils/consts.go b/utils/consts.go index 657a69687..4196ec1ce 100755 --- a/utils/consts.go +++ b/utils/consts.go @@ -584,7 +584,7 @@ const ( SMGenericV1UpdateSession = "SMGenericV1.UpdateSession" SMGenericV1InitiateSession = "SMGenericV1.InitiateSession" LCRs = "LCRs" - MetaStatic = "*static" + MetaWeight = "*weight" MetaLeastCost = "*least_cost" )