私はC ++を初めて使用します。誰かがこれらのエラーに関するガイダンス/洞察を提供できる場合はお願いします。それは大いに役立つでしょう。
次のコード fuzzyex1.cpp:
#include "fuzzyvar.h"
TControlVariable TEMPERATURE(0,1,1200);
TFuzzySet
COLD = TEMPERATURE.Trapezoid(0,0,300,500),
COOL = TEMPERATURE.Trapezoid(100,300,500,700),
TEPID = TEMPERATURE.Trapezoid(300,500,700,900),
WARM = TEMPERATURE.Trapezoid(500,700,900,1100),
HOT = TEMPERATURE.Trapezoid(700,900,1200,1200);
TSolutionVariable POWER(0,1,100);
TFuzzySet
LOW = POWER.Trapezoid(0,0,30,50),
MEDIUM = POWER.Triangle(30,50,70),
HIGH = POWER.Trapezoid(50,70,100,100);
void FuzzyController(float Temperature, float &Power)
{
TEMPERATURE = Temperature;
If (TEMPERATURE is COLD) then (POWER should be HIGH);
If (TEMPERATURE is TEPID) then (POWER should be MEDIUM);
If (TEMPERATURE is WARM) then (POWER should be LOW);
Power = POWER.Defuzzification();
}
次のエラーが発生します。
fuzzyex1.cpp:6: error: no matching function for call to TFuzzySet::TFuzzySet(TFuzzySet)’
fuzzyset.h:14: note: candidates are: TFuzzySet::TFuzzySet(TFuzzySet&)
fuzzyset.h:13: note: TFuzzySet::TFuzzySet(TUniverse*)
fuzzyset.h:12: note: TFuzzySet::TFuzzySet()
fuzzyex1.cpp:7: error: no matching function for call to TFuzzySet::TFuzzySet(TFuzzySet)’
fuzzyset.h:14: note: candidates are: TFuzzySet::TFuzzySet(TFuzzySet&)
fuzzyset.h:13: note: TFuzzySet::TFuzzySet(TUniverse*)
fuzzyset.h:12: note: TFuzzySet::TFuzzySet()
同様のコード行についても同様です。
fuzzyset.h は次のとおりです。
#include "membership.h"
#include "universe.h"
class TFuzzySet
{
protected:
TMembershipDegree *Membership;
TUniverse *Universe;
unsigned Size;
public:
TFuzzySet();
TFuzzySet(TUniverse *AUniverse);
TFuzzySet(TFuzzySet &Set);
void SetUniverse(TUniverse *AUniverse);
TUniverse *GetUniverse();
TMembershipDegree &operator [](unsigned Index);
TMembershipDegree MembershipDegree(float Valor);
void Clear();
TFuzzySet operator or(TFuzzySet &Op2);
TFuzzySet operator and(TFuzzySet &Op2);
TFuzzySet operator not();
TFuzzySet operator and(TMembershipDegree &Op2);
TFuzzySet &operator =(TFuzzySet &Op);
~TFuzzySet() ;
};
class TSolutionFuzzySet : public TFuzzySet
{
public:
TSolutionFuzzySet();
TSolutionFuzzySet(TUniverse *AUniverse);
TSolutionFuzzySet &operator=(TFuzzySet &Op);
float Sum();
float WeightedSum();
float Centroid();
float MaxMean() ;
};