From a5c2d5fee7f628bea4a58b1f7e89638c97add379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20W=C3=B3jtowicz?= Date: Fri, 18 Mar 2016 13:04:29 +0100 Subject: [PATCH] Added project files --- dep/fl/Console.h | 90 ++++++ dep/fl/Engine.h | 152 ++++++++++ dep/fl/Exception.h | 66 +++++ dep/fl/Headers.h | 131 +++++++++ dep/fl/Operation.h | 144 ++++++++++ dep/fl/defuzzifier/Bisector.h | 49 ++++ dep/fl/defuzzifier/Centroid.h | 47 +++ dep/fl/defuzzifier/Defuzzifier.h | 53 ++++ dep/fl/defuzzifier/IntegralDefuzzifier.h | 53 ++++ dep/fl/defuzzifier/LargestOfMaximum.h | 47 +++ dep/fl/defuzzifier/MeanOfMaximum.h | 48 ++++ dep/fl/defuzzifier/SmallestOfMaximum.h | 48 ++++ dep/fl/defuzzifier/WeightedAverage.h | 50 ++++ dep/fl/defuzzifier/WeightedDefuzzifier.h | 63 ++++ dep/fl/defuzzifier/WeightedSum.h | 50 ++++ dep/fl/factory/CloningFactory.h | 62 ++++ dep/fl/factory/ConstructionFactory.h | 64 +++++ dep/fl/factory/DefuzzifierFactory.h | 51 ++++ dep/fl/factory/FactoryManager.h | 81 ++++++ dep/fl/factory/FunctionFactory.h | 51 ++++ dep/fl/factory/HedgeFactory.h | 42 +++ dep/fl/factory/SNormFactory.h | 42 +++ dep/fl/factory/TNormFactory.h | 42 +++ dep/fl/factory/TermFactory.h | 43 +++ dep/fl/fuzzylite.h | 222 ++++++++++++++ dep/fl/hedge/Any.h | 47 +++ dep/fl/hedge/Extremely.h | 42 +++ dep/fl/hedge/Hedge.h | 51 ++++ dep/fl/hedge/Not.h | 42 +++ dep/fl/hedge/Seldom.h | 42 +++ dep/fl/hedge/Somewhat.h | 42 +++ dep/fl/hedge/Very.h | 42 +++ dep/fl/imex/CppExporter.h | 70 +++++ dep/fl/imex/Exporter.h | 52 ++++ dep/fl/imex/FclExporter.h | 70 +++++ dep/fl/imex/FclImporter.h | 74 +++++ dep/fl/imex/FisExporter.h | 74 +++++ dep/fl/imex/FisImporter.h | 79 +++++ dep/fl/imex/FldExporter.h | 84 ++++++ dep/fl/imex/FllExporter.h | 83 ++++++ dep/fl/imex/FllImporter.h | 77 +++++ dep/fl/imex/Importer.h | 52 ++++ dep/fl/imex/JavaExporter.h | 68 +++++ dep/fl/norm/Norm.h | 55 ++++ dep/fl/norm/SNorm.h | 47 +++ dep/fl/norm/TNorm.h | 47 +++ dep/fl/norm/s/AlgebraicSum.h | 46 +++ dep/fl/norm/s/BoundedSum.h | 43 +++ dep/fl/norm/s/DrasticSum.h | 43 +++ dep/fl/norm/s/EinsteinSum.h | 44 +++ dep/fl/norm/s/HamacherSum.h | 44 +++ dep/fl/norm/s/Maximum.h | 45 +++ dep/fl/norm/s/NilpotentMaximum.h | 43 +++ dep/fl/norm/s/NormalizedSum.h | 44 +++ dep/fl/norm/t/AlgebraicProduct.h | 45 +++ dep/fl/norm/t/BoundedDifference.h | 44 +++ dep/fl/norm/t/DrasticProduct.h | 45 +++ dep/fl/norm/t/EinsteinProduct.h | 45 +++ dep/fl/norm/t/HamacherProduct.h | 44 +++ dep/fl/norm/t/Minimum.h | 44 +++ dep/fl/norm/t/NilpotentMinimum.h | 43 +++ dep/fl/rule/Antecedent.h | 77 +++++ dep/fl/rule/Consequent.h | 68 +++++ dep/fl/rule/Expression.h | 84 ++++++ dep/fl/rule/Rule.h | 121 ++++++++ dep/fl/rule/RuleBlock.h | 97 +++++++ dep/fl/term/Accumulated.h | 94 ++++++ dep/fl/term/Activated.h | 65 +++++ dep/fl/term/Bell.h | 68 +++++ dep/fl/term/Concave.h | 64 +++++ dep/fl/term/Constant.h | 58 ++++ dep/fl/term/Cosine.h | 62 ++++ dep/fl/term/Discrete.h | 81 ++++++ dep/fl/term/Function.h | 171 +++++++++++ dep/fl/term/Gaussian.h | 63 ++++ dep/fl/term/GaussianProduct.h | 73 +++++ dep/fl/term/Linear.h | 72 +++++ dep/fl/term/PiShape.h | 74 +++++ dep/fl/term/Ramp.h | 68 +++++ dep/fl/term/Rectangle.h | 62 ++++ dep/fl/term/SShape.h | 64 +++++ dep/fl/term/Sigmoid.h | 68 +++++ dep/fl/term/SigmoidDifference.h | 73 +++++ dep/fl/term/SigmoidProduct.h | 73 +++++ dep/fl/term/Spike.h | 62 ++++ dep/fl/term/Term.h | 71 +++++ dep/fl/term/Trapezoid.h | 69 +++++ dep/fl/term/Triangle.h | 68 +++++ dep/fl/term/ZShape.h | 63 ++++ dep/fl/variable/InputVariable.h | 52 ++++ dep/fl/variable/OutputVariable.h | 90 ++++++ dep/fl/variable/Variable.h | 96 +++++++ driver.fcl | 91 ++++++ src/BaseDriver.cpp | 24 ++ src/BaseDriver.h | 51 ++++ src/CarControl.cpp | 156 ++++++++++ src/CarControl.h | 78 +++++ src/CarState.cpp | 274 ++++++++++++++++++ src/CarState.h | 99 +++++++ src/FuzzyDriver.cpp | 128 +++++++++ src/FuzzyDriver.h | 46 +++ src/SimpleDriver.cpp | 323 +++++++++++++++++++++ src/SimpleDriver.h | 118 ++++++++ src/SimpleParser.cpp | 124 ++++++++ src/SimpleParser.h | 34 +++ src/WrapperBaseDriver.cpp | 24 ++ src/WrapperBaseDriver.h | 34 +++ src/main.cpp | 351 +++++++++++++++++++++++ torcs-client-fuzzy-cpp.sln | 28 ++ torcs-client-fuzzy-cpp.vcxproj | 185 ++++++++++++ torcs-client-fuzzy-cpp.vcxproj.filters | 60 ++++ 111 files changed, 8292 insertions(+) create mode 100644 dep/fl/Console.h create mode 100644 dep/fl/Engine.h create mode 100644 dep/fl/Exception.h create mode 100644 dep/fl/Headers.h create mode 100644 dep/fl/Operation.h create mode 100644 dep/fl/defuzzifier/Bisector.h create mode 100644 dep/fl/defuzzifier/Centroid.h create mode 100644 dep/fl/defuzzifier/Defuzzifier.h create mode 100644 dep/fl/defuzzifier/IntegralDefuzzifier.h create mode 100644 dep/fl/defuzzifier/LargestOfMaximum.h create mode 100644 dep/fl/defuzzifier/MeanOfMaximum.h create mode 100644 dep/fl/defuzzifier/SmallestOfMaximum.h create mode 100644 dep/fl/defuzzifier/WeightedAverage.h create mode 100644 dep/fl/defuzzifier/WeightedDefuzzifier.h create mode 100644 dep/fl/defuzzifier/WeightedSum.h create mode 100644 dep/fl/factory/CloningFactory.h create mode 100644 dep/fl/factory/ConstructionFactory.h create mode 100644 dep/fl/factory/DefuzzifierFactory.h create mode 100644 dep/fl/factory/FactoryManager.h create mode 100644 dep/fl/factory/FunctionFactory.h create mode 100644 dep/fl/factory/HedgeFactory.h create mode 100644 dep/fl/factory/SNormFactory.h create mode 100644 dep/fl/factory/TNormFactory.h create mode 100644 dep/fl/factory/TermFactory.h create mode 100644 dep/fl/fuzzylite.h create mode 100644 dep/fl/hedge/Any.h create mode 100644 dep/fl/hedge/Extremely.h create mode 100644 dep/fl/hedge/Hedge.h create mode 100644 dep/fl/hedge/Not.h create mode 100644 dep/fl/hedge/Seldom.h create mode 100644 dep/fl/hedge/Somewhat.h create mode 100644 dep/fl/hedge/Very.h create mode 100644 dep/fl/imex/CppExporter.h create mode 100644 dep/fl/imex/Exporter.h create mode 100644 dep/fl/imex/FclExporter.h create mode 100644 dep/fl/imex/FclImporter.h create mode 100644 dep/fl/imex/FisExporter.h create mode 100644 dep/fl/imex/FisImporter.h create mode 100644 dep/fl/imex/FldExporter.h create mode 100644 dep/fl/imex/FllExporter.h create mode 100644 dep/fl/imex/FllImporter.h create mode 100644 dep/fl/imex/Importer.h create mode 100644 dep/fl/imex/JavaExporter.h create mode 100644 dep/fl/norm/Norm.h create mode 100644 dep/fl/norm/SNorm.h create mode 100644 dep/fl/norm/TNorm.h create mode 100644 dep/fl/norm/s/AlgebraicSum.h create mode 100644 dep/fl/norm/s/BoundedSum.h create mode 100644 dep/fl/norm/s/DrasticSum.h create mode 100644 dep/fl/norm/s/EinsteinSum.h create mode 100644 dep/fl/norm/s/HamacherSum.h create mode 100644 dep/fl/norm/s/Maximum.h create mode 100644 dep/fl/norm/s/NilpotentMaximum.h create mode 100644 dep/fl/norm/s/NormalizedSum.h create mode 100644 dep/fl/norm/t/AlgebraicProduct.h create mode 100644 dep/fl/norm/t/BoundedDifference.h create mode 100644 dep/fl/norm/t/DrasticProduct.h create mode 100644 dep/fl/norm/t/EinsteinProduct.h create mode 100644 dep/fl/norm/t/HamacherProduct.h create mode 100644 dep/fl/norm/t/Minimum.h create mode 100644 dep/fl/norm/t/NilpotentMinimum.h create mode 100644 dep/fl/rule/Antecedent.h create mode 100644 dep/fl/rule/Consequent.h create mode 100644 dep/fl/rule/Expression.h create mode 100644 dep/fl/rule/Rule.h create mode 100644 dep/fl/rule/RuleBlock.h create mode 100644 dep/fl/term/Accumulated.h create mode 100644 dep/fl/term/Activated.h create mode 100644 dep/fl/term/Bell.h create mode 100644 dep/fl/term/Concave.h create mode 100644 dep/fl/term/Constant.h create mode 100644 dep/fl/term/Cosine.h create mode 100644 dep/fl/term/Discrete.h create mode 100644 dep/fl/term/Function.h create mode 100644 dep/fl/term/Gaussian.h create mode 100644 dep/fl/term/GaussianProduct.h create mode 100644 dep/fl/term/Linear.h create mode 100644 dep/fl/term/PiShape.h create mode 100644 dep/fl/term/Ramp.h create mode 100644 dep/fl/term/Rectangle.h create mode 100644 dep/fl/term/SShape.h create mode 100644 dep/fl/term/Sigmoid.h create mode 100644 dep/fl/term/SigmoidDifference.h create mode 100644 dep/fl/term/SigmoidProduct.h create mode 100644 dep/fl/term/Spike.h create mode 100644 dep/fl/term/Term.h create mode 100644 dep/fl/term/Trapezoid.h create mode 100644 dep/fl/term/Triangle.h create mode 100644 dep/fl/term/ZShape.h create mode 100644 dep/fl/variable/InputVariable.h create mode 100644 dep/fl/variable/OutputVariable.h create mode 100644 dep/fl/variable/Variable.h create mode 100644 driver.fcl create mode 100644 src/BaseDriver.cpp create mode 100644 src/BaseDriver.h create mode 100644 src/CarControl.cpp create mode 100644 src/CarControl.h create mode 100644 src/CarState.cpp create mode 100644 src/CarState.h create mode 100644 src/FuzzyDriver.cpp create mode 100644 src/FuzzyDriver.h create mode 100644 src/SimpleDriver.cpp create mode 100644 src/SimpleDriver.h create mode 100644 src/SimpleParser.cpp create mode 100644 src/SimpleParser.h create mode 100644 src/WrapperBaseDriver.cpp create mode 100644 src/WrapperBaseDriver.h create mode 100644 src/main.cpp create mode 100644 torcs-client-fuzzy-cpp.sln create mode 100644 torcs-client-fuzzy-cpp.vcxproj create mode 100644 torcs-client-fuzzy-cpp.vcxproj.filters diff --git a/dep/fl/Console.h b/dep/fl/Console.h new file mode 100644 index 0000000..59e818d --- /dev/null +++ b/dep/fl/Console.h @@ -0,0 +1,90 @@ +/* + Author: Juan Rada-Vilela, Ph.D. + Copyright (C) 2010-2014 FuzzyLite Limited + All rights reserved + + This file is part of fuzzylite. + + fuzzylite is free software: you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + fuzzylite is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + for more details. + + You should have received a copy of the GNU Lesser General Public License + along with fuzzylite. If not, see . + + fuzzylite™ is a trademark of FuzzyLite Limited. + + */ + +#ifndef FL_CONSOLE_H +#define FL_CONSOLE_H + +#include "fl/fuzzylite.h" + +#include +#include +#include + +namespace fl { + class Engine; + + class FL_API Console { + public: + + struct Option { + std::string key, value, description; + + explicit Option(const std::string& key = "", const std::string& value = "", const std::string& description = "") : + key(key), value(value), description(description) { + } + }; + + static const std::string KW_INPUT_FILE; + static const std::string KW_INPUT_FORMAT; + static const std::string KW_OUTPUT_FILE; + static const std::string KW_OUTPUT_FORMAT; + static const std::string KW_EXAMPLE; + static const std::string KW_DECIMALS; + static const std::string KW_DATA_INPUT; + static const std::string KW_DATA_MAXIMUM; + static const std::string KW_DATA_EXPORT_HEADER; + static const std::string KW_DATA_EXPORT_INPUTS; + + static Engine* mamdani(); + static Engine* takagiSugeno(); + + protected: + static std::map parse(int argc, char** argv); + static void process(const std::map& options); + + static void process(const std::string& input, std::ostream& writer, + const std::string& inputFormat, const std::string& outputFormat, + const std::map& options); + + static int readCharacter(); + static void interactive(std::ostream& writer, Engine* engine); + static std::string interactiveHelp(); + + static void exportAllExamples(const std::string& from, const std::string& to); + static void exportAllExamples(const std::string& from, const std::string& to, const std::string& path); +#ifdef FL_CPP11 + static void benchmarkExamples(const std::string& path, int runs); +#endif + + public: + static std::string usage(); + static std::vector