diff --git a/moeo/src/continue/moeoHypContinue.h b/moeo/src/continue/moeoHypContinue.h index 9ecc5424e..5fd5c47ad 100644 --- a/moeo/src/continue/moeoHypContinue.h +++ b/moeo/src/continue/moeoHypContinue.h @@ -59,7 +59,7 @@ public: typedef typename ObjectiveVector::Type AtomType; /// Ctor - moeoHypContinue( const std::vector & _OptimVec, moeoArchive < MOEOT > & _archive, bool _normalize=true, AtomType _rho=1.1) + moeoHypContinue( const std::vector & _OptimVec, moeoArchive < MOEOT > & _archive, bool _normalize=true, double _rho=1.1) : eoContinue(), arch(_archive), metric(_normalize,_rho) { vectorToParetoSet(_OptimVec); diff --git a/moeo/src/core/moeoDualRealObjectiveVector.h b/moeo/src/core/moeoDualRealObjectiveVector.h index 9be12d8f7..dbba265c0 100644 --- a/moeo/src/core/moeoDualRealObjectiveVector.h +++ b/moeo/src/core/moeoDualRealObjectiveVector.h @@ -33,17 +33,19 @@ Authors: #include #include -#include +#include -template < class ObjectiveVectorTraits > -class moeoDualRealObjectiveVector : public moeoScalarObjectiveVector +template < class ObjectiveVectorTraits, class T = eoMinimizingDualFitness /* can be an eoMaximizingDualFitness */> +class moeoDualRealObjectiveVector : public moeoScalarObjectiveVector { protected: bool _is_feasible; public: - moeoDualRealObjectiveVector(double value=0.0) : moeoScalarObjectiveVector(value, false) {} + moeoDualRealObjectiveVector(double value=0.0) + : moeoScalarObjectiveVector + ( T(value, false) ) {} bool is_feasible() const { diff --git a/moeo/src/core/moeoScalarObjectiveVector.h b/moeo/src/core/moeoScalarObjectiveVector.h index 0f33812c3..9d1183ad7 100644 --- a/moeo/src/core/moeoScalarObjectiveVector.h +++ b/moeo/src/core/moeoScalarObjectiveVector.h @@ -151,8 +151,8 @@ class moeoScalarObjectiveVector : public moeoObjectiveVector < ObjectiveVectorTr * @param _os output stream * @param _objectiveVector the objective vector to write */ -template < class ObjectiveVectorTraits > -std::ostream & operator<<(std::ostream & _os, const moeoScalarObjectiveVector < ObjectiveVectorTraits > & _objectiveVector) +template < class ObjectiveVectorTraits, class T > +std::ostream & operator<<(std::ostream & _os, const moeoScalarObjectiveVector < ObjectiveVectorTraits, T > & _objectiveVector) { for (unsigned int i=0; i<_objectiveVector.size()-1; i++) _os << _objectiveVector[i] << " "; @@ -165,10 +165,10 @@ std::ostream & operator<<(std::ostream & _os, const moeoScalarObjectiveVector < * @param _is input stream * @param _objectiveVector the objective vector to read */ -template < class ObjectiveVectorTraits > -std::istream & operator>>(std::istream & _is, moeoScalarObjectiveVector < ObjectiveVectorTraits > & _objectiveVector) +template < class ObjectiveVectorTraits, class T > +std::istream & operator>>(std::istream & _is, moeoScalarObjectiveVector < ObjectiveVectorTraits, T > & _objectiveVector) { - _objectiveVector = moeoScalarObjectiveVector < ObjectiveVectorTraits > (); + _objectiveVector = moeoScalarObjectiveVector < ObjectiveVectorTraits, T > (); for (unsigned int i=0; i<_objectiveVector.size(); i++) { _is >> _objectiveVector[i]; diff --git a/moeo/src/fitness/moeoExpBinaryIndicatorBasedFitnessAssignment.h b/moeo/src/fitness/moeoExpBinaryIndicatorBasedFitnessAssignment.h index a25382f41..3159c2840 100644 --- a/moeo/src/fitness/moeoExpBinaryIndicatorBasedFitnessAssignment.h +++ b/moeo/src/fitness/moeoExpBinaryIndicatorBasedFitnessAssignment.h @@ -154,7 +154,7 @@ class moeoExpBinaryIndicatorBasedFitnessAssignment : public moeoBinaryIndicatorB */ void setup(const eoPop < MOEOT > & _pop) { - double min, max; + typename MOEOT::ObjectiveVector::Type min, max; for (unsigned int i=0; i