优化日算法
This commit is contained in:
@@ -169,7 +169,8 @@ func (r *recipeServiceImpl) GenerateRecipeWithPrioritizedStockRawMaterials(ctx c
|
||||
for _, mat := range stockMaterials {
|
||||
adjustedMat := mat // 复制一份
|
||||
// 大幅调低有库存原料的参考价格,诱导生成器优先使用
|
||||
adjustedMat.ReferencePrice = 0.01 // 设置一个非常小的价格
|
||||
// TODO 按理说应该尽量优先使用已有原料, 但如果搭配后购买缺失原料花的钱还不如不用已有原料的另一个组合钱少怎么办
|
||||
adjustedMat.ReferencePrice = adjustedMat.ReferencePrice * 0.1
|
||||
materialsForGeneration = append(materialsForGeneration, adjustedMat)
|
||||
logger.Debugf("原料 '%s' (ID: %d) 有库存,生成配方时参考价格调整为 %.2f", mat.Name, mat.ID, adjustedMat.ReferencePrice)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user