From 9ef0481610ee04bacf31d84799f3df700d103023 Mon Sep 17 00:00:00 2001 From: Dydzio Date: Tue, 9 Oct 2018 15:59:00 +0200 Subject: [PATCH] object value terms rework --- AI/VCAI/FuzzyEngines.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/AI/VCAI/FuzzyEngines.cpp b/AI/VCAI/FuzzyEngines.cpp index 3cdca74b3..e1a99c6ac 100644 --- a/AI/VCAI/FuzzyEngines.cpp +++ b/AI/VCAI/FuzzyEngines.cpp @@ -350,11 +350,12 @@ VisitObjEngine::VisitObjEngine() engine.addInputVariable(objectValue); - //objectValue ranges are based on checking RMG priorities of some objects and trying to guess sane value ranges - objectValue->addTerm(new fl::Ramp("LOW", 3000, 0)); //I have feeling that concave shape might work well instead of ramp for objectValue FL terms - objectValue->addTerm(new fl::Triangle("MEDIUM", 2500, 6000)); - objectValue->addTerm(new fl::Ramp("HIGH", 5000, 20000)); - objectValue->setRange(0, 20000); //relic artifact value is border value by design, even better things are scaled down. + //objectValue ranges are based on checking RMG priorities of some objects and checking LOW/MID/HIGH proportions for various values in QtFuzzyLite + objectValue->addTerm(new fl::Ramp("LOW", 3500.0, 0.0)); + objectValue->addTerm(new fl::Triangle("MEDIUM", 0.0, 8500.0)); + std::vector multiRamp = { fl::Discrete::Pair(5000.0, 0.0), fl::Discrete::Pair(10000.0, 0.75), fl::Discrete::Pair(20000.0, 1.0) }; + objectValue->addTerm(new fl::Discrete("HIGH", multiRamp)); + objectValue->setRange(0.0, 20000.0); //relic artifact value is border value by design, even better things are scaled down. addRule("if objectValue is HIGH then Value is HIGH"); addRule("if objectValue is MEDIUM then Value is MEDIUM");