indent all

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@232 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
liefooga 2007-04-13 15:05:07 +00:00
commit c8049ca6cd
51 changed files with 3899 additions and 3898 deletions

View file

@ -24,89 +24,89 @@
typedef moeoObjectiveVectorDouble<moeoObjectiveVectorTraits> FlowShopObjectiveVector;
/**
/**
* Structure of the genotype for the flow-shop scheduling problem
*/
class FlowShop: public MOEO<FlowShopObjectiveVector, double, double> {
public:
/**
* default constructor
*/
FlowShop() {}
/**
* default constructor
*/
FlowShop() {}
/**
* destructor
*/
virtual ~FlowShop() {}
/**
* class name
*/
virtual string className() const {
return "FlowShop";
}
/**
* destructor
*/
virtual ~FlowShop() {}
/**
* set scheduling vector
* @param vector<unsigned> & _scheduling the new scheduling to set
*/
void setScheduling(vector<unsigned> & _scheduling) {
scheduling = _scheduling;
}
/**
* get scheduling vector
*/
const vector<unsigned> & getScheduling() const {
return scheduling;
}
/**
* printing...
*/
void printOn(ostream& _os) const {
// fitness
MOEO<FlowShopObjectiveVector, double, double>::printOn(_os);
// size
_os << scheduling.size() << "\t" ;
// scheduling
for (unsigned i=0; i<scheduling.size(); i++)
_os << scheduling[i] << ' ' ;
}
/**
* reading...
*/
void readFrom(istream& _is) {
// fitness
MOEO<FlowShopObjectiveVector, double, double>::readFrom(_is);
// size
unsigned size;
_is >> size;
// scheduling
scheduling.resize(size);
bool tmp;
for (unsigned i=0; i<size; i++) {
_is >> tmp;
scheduling[i] = tmp;
/**
* class name
*/
virtual string className() const {
return "FlowShop";
}
}
bool operator==(const FlowShop& _other) const { return scheduling == _other.getScheduling(); }
bool operator!=(const FlowShop& _other) const { return scheduling != _other.getScheduling(); }
bool operator< (const FlowShop& _other) const { return scheduling < _other.getScheduling(); }
bool operator> (const FlowShop& _other) const { return scheduling > _other.getScheduling(); }
bool operator<=(const FlowShop& _other) const { return scheduling <= _other.getScheduling(); }
bool operator>=(const FlowShop& _other) const { return scheduling >= _other.getScheduling(); }
/**
* set scheduling vector
* @param vector<unsigned> & _scheduling the new scheduling to set
*/
void setScheduling(vector<unsigned> & _scheduling) {
scheduling = _scheduling;
}
/**
* get scheduling vector
*/
const vector<unsigned> & getScheduling() const {
return scheduling;
}
/**
* printing...
*/
void printOn(ostream& _os) const {
// fitness
MOEO<FlowShopObjectiveVector, double, double>::printOn(_os);
// size
_os << scheduling.size() << "\t" ;
// scheduling
for (unsigned i=0; i<scheduling.size(); i++)
_os << scheduling[i] << ' ' ;
}
/**
* reading...
*/
void readFrom(istream& _is) {
// fitness
MOEO<FlowShopObjectiveVector, double, double>::readFrom(_is);
// size
unsigned size;
_is >> size;
// scheduling
scheduling.resize(size);
bool tmp;
for (unsigned i=0; i<size; i++) {
_is >> tmp;
scheduling[i] = tmp;
}
}
bool operator==(const FlowShop& _other) const { return scheduling == _other.getScheduling(); }
bool operator!=(const FlowShop& _other) const { return scheduling != _other.getScheduling(); }
bool operator< (const FlowShop& _other) const { return scheduling < _other.getScheduling(); }
bool operator> (const FlowShop& _other) const { return scheduling > _other.getScheduling(); }
bool operator<=(const FlowShop& _other) const { return scheduling <= _other.getScheduling(); }
bool operator>=(const FlowShop& _other) const { return scheduling >= _other.getScheduling(); }
private:
/** scheduling (order of operations) */
std::vector<unsigned> scheduling;
/** scheduling (order of operations) */
std::vector<unsigned> scheduling;
};