AUTHORS modification
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@152 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
cde1586361
commit
4c21c72510
137 changed files with 2356 additions and 2369 deletions
|
|
@ -1,25 +1,14 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "FlowShop.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
// FlowShop.h
|
||||
// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2006
|
||||
/*
|
||||
This library...
|
||||
|
||||
// (c) OPAC Team, LIFL, April 2006
|
||||
|
||||
/* This library 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 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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 this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: Arnaud.Liefooghe@lifl.fr
|
||||
*/
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _FlowShop_h
|
||||
#define _FlowShop_h
|
||||
|
|
|
|||
|
|
@ -1,25 +1,14 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "FlowShopBenchmarkParser.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
// FlowShopBenchmarkParser.h
|
||||
// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2006
|
||||
/*
|
||||
This library...
|
||||
|
||||
// (c) OPAC Team, LIFL, March 2006
|
||||
|
||||
/* This library 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 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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 this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: Arnaud.Liefooghe@lifl.fr
|
||||
*/
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _FlowShopBenchmarkParser_h
|
||||
#define _FlowShopBenchmarkParser_h
|
||||
|
|
@ -38,7 +27,8 @@ const static
|
|||
* Class to handle parameters of a flow-shop instance from a benchmark file
|
||||
* benchmark files are available at www.lifl.fr/~basseur/BenchsUncertain/
|
||||
*/
|
||||
class FlowShopBenchmarkParser
|
||||
class
|
||||
FlowShopBenchmarkParser
|
||||
{
|
||||
|
||||
public:
|
||||
|
|
@ -74,7 +64,8 @@ public:
|
|||
* the processing times
|
||||
*/
|
||||
const
|
||||
std::vector < std::vector < unsigned > >
|
||||
std::vector <
|
||||
std::vector < unsigned > >
|
||||
getP ()
|
||||
{
|
||||
return p;
|
||||
|
|
@ -144,9 +135,11 @@ private:
|
|||
void
|
||||
init (const string _benchmarkFileName)
|
||||
{
|
||||
string buffer;
|
||||
string
|
||||
buffer;
|
||||
string::size_type start, end;
|
||||
ifstream inputFile (_benchmarkFileName.data (), ios::in);
|
||||
ifstream
|
||||
inputFile (_benchmarkFileName.data (), ios::in);
|
||||
// opening of the benchmark file
|
||||
if (!inputFile)
|
||||
cerr << "*** ERROR : Unable to open the benchmark file '" <<
|
||||
|
|
@ -161,7 +154,7 @@ private:
|
|||
getline (inputFile, buffer, '\n');
|
||||
// processing times and due-dates
|
||||
p = std::vector < std::vector < unsigned > > (M, N);
|
||||
d = std::vector < unsigned > (N);
|
||||
d = std::vector < unsigned >(N);
|
||||
// for each job...
|
||||
for (unsigned j = 0; j < N; j++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,26 +1,14 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "FlowShopEA.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, October 2006
|
||||
|
||||
/* This library 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 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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 this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: Arnaud.Liefooghe@lifl.fr
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
// FlowShopEA.cpp
|
||||
// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2006
|
||||
/*
|
||||
This library...
|
||||
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Miscilaneous include and declaration
|
||||
using namespace std;
|
||||
|
|
|
|||
|
|
@ -1,25 +1,14 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "FlowShopEval.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
// FlowShopEval.h
|
||||
// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2006
|
||||
/*
|
||||
This library...
|
||||
|
||||
// (c) OPAC Team, LIFL, March 2006
|
||||
|
||||
/* This library 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 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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 this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: Arnaud.Liefooghe@lifl.fr
|
||||
*/
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _FlowShopEval_h
|
||||
#define _FlowShopEval_h
|
||||
|
|
@ -63,7 +52,7 @@ public:
|
|||
* computation of the multi-objective evaluation of an eoFlowShop object
|
||||
* @param FlowShop & _eo the FlowShop object to evaluate
|
||||
*/
|
||||
void operator () (FlowShop & _eo)
|
||||
void operator () (FlowShop & _eo)
|
||||
{
|
||||
FlowShopFitness fitness;
|
||||
fitness[0] = tardiness (_eo);
|
||||
|
|
@ -82,9 +71,9 @@ private:
|
|||
/** number of jobs */
|
||||
unsigned N;
|
||||
/** p[i][j] = processing time of job j on machine i */
|
||||
std::vector < std::vector < unsigned > > p;
|
||||
std::vector < std::vector < unsigned > >p;
|
||||
/** d[j] = due-date of the job j */
|
||||
std::vector < unsigned > d;
|
||||
std::vector < unsigned >d;
|
||||
|
||||
|
||||
|
||||
|
|
@ -98,7 +87,7 @@ private:
|
|||
vector < unsigned >scheduling = _eo.getScheduling ();
|
||||
// completion times computation for each job on each machine
|
||||
// C[i][j] = completion of the jth job of the scheduling on the ith machine
|
||||
std::vector < std::vector < unsigned > > C = completionTime (_eo);
|
||||
std::vector < std::vector < unsigned > >C = completionTime (_eo);
|
||||
// fitness == C[M-1][scheduling[N-1]];
|
||||
return C[M - 1][scheduling[N - 1]];
|
||||
}
|
||||
|
|
@ -115,7 +104,7 @@ private:
|
|||
vector < unsigned >scheduling = _eo.getScheduling ();
|
||||
// completion times computation for each job on each machine
|
||||
// C[i][j] = completion of the jth job of the scheduling on the ith machine
|
||||
std::vector < std::vector < unsigned > > C = completionTime (_eo);
|
||||
std::vector < std::vector < unsigned > >C = completionTime (_eo);
|
||||
// tardiness computation
|
||||
unsigned long sum = 0;
|
||||
for (unsigned j = 0; j < N; j++)
|
||||
|
|
@ -134,10 +123,10 @@ private:
|
|||
* C[i][j] = completion of the jth job of the scheduling on the ith machine
|
||||
* @param const FlowShop _eo the genotype to evaluate
|
||||
*/
|
||||
std::vector < std::vector < unsigned > > completionTime (FlowShop _eo)
|
||||
std::vector < std::vector < unsigned > >completionTime (FlowShop _eo)
|
||||
{
|
||||
vector < unsigned > scheduling = _eo.getScheduling ();
|
||||
std::vector < std::vector < unsigned > > C (M, N);
|
||||
vector < unsigned >scheduling = _eo.getScheduling ();
|
||||
std::vector < std::vector < unsigned > >C (M, N);
|
||||
C[0][scheduling[0]] = p[0][scheduling[0]];
|
||||
for (unsigned j = 1; j < N; j++)
|
||||
C[0][scheduling[j]] = C[0][scheduling[j - 1]] + p[0][scheduling[j]];
|
||||
|
|
|
|||
|
|
@ -1,25 +1,14 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "FlowShopFitness.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
// FlowShopFitness.h
|
||||
// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2006
|
||||
/*
|
||||
This library...
|
||||
|
||||
// (c) OPAC Team, LIFL, March 2006
|
||||
|
||||
/* This library 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 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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 this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: Arnaud.Liefooghe@lifl.fr
|
||||
*/
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _FlowShopFitness_h
|
||||
#define _FlowShopFitness_h
|
||||
|
|
|
|||
|
|
@ -1,25 +1,14 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "FlowShopInit.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
// FlowShopInit.h
|
||||
// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2006
|
||||
/*
|
||||
This library...
|
||||
|
||||
// (c) OPAC Team, LIFL, March 2006
|
||||
|
||||
/* This library 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 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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 this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: Arnaud.Liefooghe@lifl.fr
|
||||
*/
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _FlowShopInit_h
|
||||
#define _FlowShopInit_h
|
||||
|
|
@ -49,7 +38,7 @@ public:
|
|||
* randomize a genotype
|
||||
* @param FlowShop & _genotype a genotype that has been default-constructed
|
||||
*/
|
||||
void operator () (FlowShop & _genotype)
|
||||
void operator () (FlowShop & _genotype)
|
||||
{
|
||||
// scheduling vector
|
||||
vector < unsigned >scheduling (N);
|
||||
|
|
|
|||
|
|
@ -1,25 +1,14 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "FlowShopOpCrossoverQuad.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
// FlowShopOpCrossoverQuad.h
|
||||
// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2006
|
||||
/*
|
||||
This library...
|
||||
|
||||
// (c) OPAC Team, LIFL, April 2006
|
||||
|
||||
/* This library 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 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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 this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: Arnaud.Liefooghe@lifl.fr
|
||||
*/
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _FlowShopOpCrossoverQuad_h
|
||||
#define _FlowShopOpCrossoverQuad_h
|
||||
|
|
@ -55,7 +44,7 @@ public:
|
|||
* @param FlowShop & _genotype1 the first parent
|
||||
* @param FlowShop & _genotype2 the second parent
|
||||
*/
|
||||
bool operator () (FlowShop & _genotype1, FlowShop & _genotype2)
|
||||
bool operator () (FlowShop & _genotype1, FlowShop & _genotype2)
|
||||
{
|
||||
bool oneAtLeastIsModified;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,25 +1,14 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "FlowShopOpMutationExchange.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
// FlowShopOpMutationExchange.h
|
||||
// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2006
|
||||
/*
|
||||
This library...
|
||||
|
||||
// (c) OPAC Team, LIFL, March 2006
|
||||
|
||||
/* This library 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 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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 this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: Arnaud.Liefooghe@lifl.fr
|
||||
*/
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _FlowShopOpMutationExchange_h
|
||||
#define _FlowShopOpMutationExchange_h
|
||||
|
|
@ -55,7 +44,7 @@ public:
|
|||
* modifies the parent with an exchange mutation
|
||||
* @param FlowShop & _genotype the parent genotype (will be modified)
|
||||
*/
|
||||
bool operator () (FlowShop & _genotype)
|
||||
bool operator () (FlowShop & _genotype)
|
||||
{
|
||||
bool isModified;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,25 +1,14 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "FlowShopOpMutationShift.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
// FlowShopOpMutationShift.h
|
||||
// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2006
|
||||
/*
|
||||
This library...
|
||||
|
||||
// (c) OPAC Team, LIFL, March 2006
|
||||
|
||||
/* This library 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 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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 this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: Arnaud.Liefooghe@lifl.fr
|
||||
*/
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _FlowShopOpMutationShift_h
|
||||
#define _FlowShopOpMutationShift_h
|
||||
|
|
@ -55,7 +44,7 @@ public:
|
|||
* modifies the parent with a shift mutation
|
||||
* @param FlowShop & _genotype the parent genotype (will be modified)
|
||||
*/
|
||||
bool operator () (FlowShop & _genotype)
|
||||
bool operator () (FlowShop & _genotype)
|
||||
{
|
||||
bool isModified;
|
||||
int direction;
|
||||
|
|
|
|||
|
|
@ -1,25 +1,14 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "make_eval_FlowShop.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
// make_eval_FlowShop.h
|
||||
// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2006
|
||||
/*
|
||||
This library...
|
||||
|
||||
// (c) OPAC Team, LIFL, March 2006
|
||||
|
||||
/* This library 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 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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 this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: Arnaud.Liefooghe@lifl.fr
|
||||
*/
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _make_eval_FlowShop_h
|
||||
#define _make_eval_FlowShop_h
|
||||
|
|
@ -59,7 +48,7 @@ eoEvalFuncCounter < FlowShop > &do_make_eval (eoParser & _parser,
|
|||
FlowShopBenchmarkParser fParser (benchmarkFileName);
|
||||
unsigned M = fParser.getM ();
|
||||
unsigned N = fParser.getN ();
|
||||
std::vector < std::vector < unsigned > > p = fParser.getP ();
|
||||
std::vector < std::vector < unsigned > >p = fParser.getP ();
|
||||
std::vector < unsigned >d = fParser.getD ();
|
||||
|
||||
// build of the initializer (a pointer, stored in the eoState)
|
||||
|
|
|
|||
|
|
@ -1,25 +1,14 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "make_genotype_FlowShop.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
// make_genotype_FlowShop.h
|
||||
// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2006
|
||||
/*
|
||||
This library...
|
||||
|
||||
// (c) OPAC Team, LIFL, March 2006
|
||||
|
||||
/* This library 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 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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 this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: Arnaud.Liefooghe@lifl.fr
|
||||
*/
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _make_genotype_FlowShop_h
|
||||
#define _make_genotype_FlowShop_h
|
||||
|
|
|
|||
|
|
@ -1,25 +1,14 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "make_op_FlowShop.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
// make_op_FlowShop.h
|
||||
// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2006
|
||||
/*
|
||||
This library...
|
||||
|
||||
// (c) OPAC Team, LIFL, March 2006
|
||||
|
||||
/* This library 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 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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 this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: Arnaud.Liefooghe@lifl.fr
|
||||
*/
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _make_op_FlowShop_h
|
||||
#define _make_op_FlowShop_h
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
noinst_PROGRAMS = Sch1
|
||||
|
||||
Sch1_SOURCES = Sch1.cpp
|
||||
Sch1_SOURCES = Sch1.cpp
|
||||
|
||||
LDADD = -L$(top_builddir)/src ${EO_DIR}/src/libeo.a ${EO_DIR}/src/utils/libeoutils.a
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,14 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
/* (c) OPAC Team, LIFL, October 2006
|
||||
//-----------------------------------------------------------------------------
|
||||
// Sch1.cpp
|
||||
// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2006
|
||||
/*
|
||||
This library...
|
||||
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*/
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
|
@ -13,81 +18,92 @@ using namespace std;
|
|||
#include <eo>
|
||||
#include <es.h>
|
||||
|
||||
/* ParadisEO-MOEO */
|
||||
/* ParadisEO-MOEO */
|
||||
#include <moeoNSGA_II.h>
|
||||
#include <moeoArchive.h>
|
||||
|
||||
|
||||
// Extend eoParetoFitnessTraits
|
||||
class SCH1Traits : public eoParetoFitnessTraits
|
||||
class SCH1Traits:public eoParetoFitnessTraits
|
||||
{
|
||||
public :
|
||||
static bool maximizing(int i) { return false; } // is the i-th objective
|
||||
static unsigned nObjectives() { return 2;} // number of objectives
|
||||
public:static bool maximizing (int i)
|
||||
{
|
||||
return false;
|
||||
} // is the i-th objective
|
||||
static unsigned nObjectives ()
|
||||
{
|
||||
return 2;
|
||||
} // number of objectives
|
||||
};
|
||||
|
||||
// Code decision variables
|
||||
typedef eoParetoFitness<SCH1Traits> SCH1Fit;
|
||||
typedef eoParetoFitness < SCH1Traits > SCH1Fit;
|
||||
|
||||
class SCH1EO : public eoReal<SCH1Fit>
|
||||
class SCH1EO:public eoReal < SCH1Fit >
|
||||
{
|
||||
public:
|
||||
SCH1EO(): eoReal<SCH1Fit>(1)
|
||||
{}
|
||||
};
|
||||
|
||||
// evaluation of the individuals
|
||||
class SCH1Eval : public eoEvalFunc<SCH1EO>
|
||||
{
|
||||
public:
|
||||
SCH1Eval(): eoEvalFunc<SCH1EO>()
|
||||
{}
|
||||
|
||||
void operator()(SCH1EO & _eo) {
|
||||
SCH1Fit fitness;
|
||||
double x = _eo[0];
|
||||
|
||||
fitness[0] = x*x;
|
||||
fitness[1] = (x-2.0)*(x-2.0);
|
||||
|
||||
_eo.fitness(fitness);
|
||||
SCH1EO ():eoReal < SCH1Fit > (1)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
// evaluation of the individuals
|
||||
class SCH1Eval:public eoEvalFunc < SCH1EO >
|
||||
{
|
||||
public:
|
||||
SCH1Eval ():eoEvalFunc < SCH1EO > ()
|
||||
{
|
||||
}
|
||||
|
||||
unsigned POP_SIZE = 20;
|
||||
unsigned MAX_GEN = 100;
|
||||
double M_EPSILON = 0.01;
|
||||
double P_CROSS = 0.25;
|
||||
double P_MUT = 0.35;
|
||||
void operator () (SCH1EO & _eo)
|
||||
{
|
||||
SCH1Fit fitness;
|
||||
double x = _eo[0];
|
||||
|
||||
// The fitness evaluation
|
||||
SCH1Eval eval;
|
||||
fitness[0] = x * x;
|
||||
fitness[1] = (x - 2.0) * (x - 2.0);
|
||||
|
||||
// choose crossover and mutation
|
||||
eoQuadCloneOp<SCH1EO> xover;
|
||||
eoUniformMutation<SCH1EO> mutation(M_EPSILON);
|
||||
|
||||
// generate initial population
|
||||
eoRealVectorBounds bounds(1, 0.0, 2.0); // [0, 2]
|
||||
eoRealInitBounded<SCH1EO> init(bounds);
|
||||
eoPop<SCH1EO> pop(POP_SIZE, init);
|
||||
_eo.fitness (fitness);
|
||||
}
|
||||
};
|
||||
|
||||
// pass parameters to NSGA2
|
||||
moeoNSGA_II<SCH1EO> nsga2(MAX_GEN, eval, xover, P_CROSS, mutation, P_MUT);
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
|
||||
// run the algo
|
||||
nsga2(pop);
|
||||
unsigned POP_SIZE = 20;
|
||||
unsigned MAX_GEN = 100;
|
||||
double M_EPSILON = 0.01;
|
||||
double P_CROSS = 0.25;
|
||||
double P_MUT = 0.35;
|
||||
|
||||
// extract first front of the final population (this is the solution of nsga2)
|
||||
moeoArchive<SCH1EO> arch;
|
||||
arch.update(pop);
|
||||
// The fitness evaluation
|
||||
SCH1Eval eval;
|
||||
|
||||
// choose crossover and mutation
|
||||
eoQuadCloneOp < SCH1EO > xover;
|
||||
eoUniformMutation < SCH1EO > mutation (M_EPSILON);
|
||||
|
||||
// generate initial population
|
||||
eoRealVectorBounds bounds (1, 0.0, 2.0); // [0, 2]
|
||||
eoRealInitBounded < SCH1EO > init (bounds);
|
||||
eoPop < SCH1EO > pop (POP_SIZE, init);
|
||||
|
||||
// pass parameters to NSGA2
|
||||
moeoNSGA_II < SCH1EO > nsga2 (MAX_GEN, eval, xover, P_CROSS, mutation,
|
||||
P_MUT);
|
||||
|
||||
// run the algo
|
||||
nsga2 (pop);
|
||||
|
||||
// extract first front of the final population (this is the solution of nsga2)
|
||||
moeoArchive < SCH1EO > arch;
|
||||
arch.update (pop);
|
||||
|
||||
// printing of the final archive
|
||||
cout << "Final Archive\n";
|
||||
arch.sortedPrintOn (cout);
|
||||
cout << endl;
|
||||
|
||||
// printing of the final archive
|
||||
cout << "Final Archive\n";
|
||||
arch.sortedPrintOn(cout);
|
||||
cout << endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue