Add problems directory and rename SimpleHCneutralExplorer in RamdomBestHCExplorer
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1735 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
67a701f9ff
commit
4819120e6c
21 changed files with 43 additions and 44 deletions
|
|
@ -35,7 +35,7 @@
|
|||
#ifndef _moHCneutralExplorer_h
|
||||
#define _moHCneutralExplorer_h
|
||||
|
||||
#include <explorer/moSimpleHCneutralExplorer.h>
|
||||
#include <explorer/moRandomBestHCExplorer.h>
|
||||
#include <comparator/moNeighborComparator.h>
|
||||
#include <comparator/moSolNeighborComparator.h>
|
||||
#include <neighborhood/moNeighborhood.h>
|
||||
|
|
@ -44,18 +44,18 @@
|
|||
* Explorer for a neutral Hill-climbing
|
||||
*/
|
||||
template< class Neighbor >
|
||||
class moHCneutralExplorer : public moSimpleHCneutralExplorer<Neighbor>
|
||||
class moHCneutralExplorer : public moRandomBestHCExplorer<Neighbor>
|
||||
{
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT ;
|
||||
typedef moNeighborhood<Neighbor> Neighborhood ;
|
||||
|
||||
using moNeighborhoodExplorer<Neighbor>::neighborhood;
|
||||
using moSimpleHCneutralExplorer<Neighbor>::solNeighborComparator;
|
||||
using moSimpleHCneutralExplorer<Neighbor>::isAccept;
|
||||
using moSimpleHCneutralExplorer<Neighbor>::bestVector;
|
||||
using moSimpleHCneutralExplorer<Neighbor>::initParam;
|
||||
using moSimpleHCneutralExplorer<Neighbor>::updateParam;
|
||||
using moRandomBestHCExplorer<Neighbor>::solNeighborComparator;
|
||||
using moRandomBestHCExplorer<Neighbor>::isAccept;
|
||||
using moRandomBestHCExplorer<Neighbor>::bestVector;
|
||||
using moRandomBestHCExplorer<Neighbor>::initParam;
|
||||
using moRandomBestHCExplorer<Neighbor>::updateParam;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
|
@ -70,7 +70,7 @@ public:
|
|||
moNeighborComparator<Neighbor>& _neighborComparator,
|
||||
moSolNeighborComparator<Neighbor>& _solNeighborComparator,
|
||||
unsigned _nbStep) :
|
||||
moSimpleHCneutralExplorer<Neighbor>(_neighborhood, _eval, _neighborComparator, _solNeighborComparator),
|
||||
moRandomBestHCExplorer<Neighbor>(_neighborhood, _eval, _neighborComparator, _solNeighborComparator),
|
||||
nbStep(_nbStep) {
|
||||
//Some cycle is possible with equals fitness solutions if the neighborhood is not random
|
||||
if (!neighborhood.isRandom()) {
|
||||
|
|
@ -88,7 +88,7 @@ public:
|
|||
* initial number of step
|
||||
*/
|
||||
virtual void initParam(EOT & solution) {
|
||||
moSimpleHCneutralExplorer<Neighbor>::initParam(solution);
|
||||
moRandomBestHCExplorer<Neighbor>::initParam(solution);
|
||||
|
||||
step = 0;
|
||||
};
|
||||
|
|
@ -97,7 +97,7 @@ public:
|
|||
* one more step
|
||||
*/
|
||||
virtual void updateParam(EOT & solution) {
|
||||
moSimpleHCneutralExplorer<Neighbor>::updateParam(solution);
|
||||
moRandomBestHCExplorer<Neighbor>::updateParam(solution);
|
||||
|
||||
step++;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -48,12 +48,12 @@
|
|||
* Explorer for an Iterated Local Search
|
||||
*/
|
||||
template< class Neighbor >
|
||||
class moILSexplorer : public moNeighborhoodExplorer< moDummyNeighbor<typename Neighbor::EOT, typename Neighbor::EOT::Fitness> >
|
||||
class moILSexplorer : public moNeighborhoodExplorer< moDummyNeighbor<typename Neighbor::EOT> >
|
||||
{
|
||||
public:
|
||||
typedef moNeighborhood<Neighbor> Neighborhood ;
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef moDummyNeighbor<EOT,typename EOT::Fitness> dummyNeighbor;
|
||||
typedef moDummyNeighbor<EOT> dummyNeighbor;
|
||||
typedef moDummyNeighborhood<dummyNeighbor> dummyNeighborhood;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
<moSimpleHCneutralExplorer.h>
|
||||
<moRandomBestHCExplorer.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau
|
||||
|
|
@ -32,8 +32,8 @@
|
|||
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*/
|
||||
|
||||
#ifndef _moSimpleHCneutralExplorer_h
|
||||
#define _moSimpleHCneutralExplorer_h
|
||||
#ifndef _moRandomBestHCExplorer_h
|
||||
#define _moRandomBestHCExplorer_h
|
||||
|
||||
#include <explorer/moNeighborhoodExplorer.h>
|
||||
#include <comparator/moNeighborComparator.h>
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
* Explorer for a simple neutral Hill-climbing
|
||||
*/
|
||||
template< class Neighbor >
|
||||
class moSimpleHCneutralExplorer : public moNeighborhoodExplorer<Neighbor>
|
||||
class moRandomBestHCExplorer : public moNeighborhoodExplorer<Neighbor>
|
||||
{
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT ;
|
||||
|
|
@ -62,7 +62,7 @@ public:
|
|||
* @param _neighborComparator a neighbor comparator
|
||||
* @param _solNeighborComparator solution vs neighbor comparator
|
||||
*/
|
||||
moSimpleHCneutralExplorer(Neighborhood& _neighborhood,
|
||||
moRandomBestHCExplorer(Neighborhood& _neighborhood,
|
||||
moEval<Neighbor>& _eval,
|
||||
moNeighborComparator<Neighbor>& _neighborComparator,
|
||||
moSolNeighborComparator<Neighbor>& _solNeighborComparator) :
|
||||
|
|
@ -76,7 +76,7 @@ public:
|
|||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~moSimpleHCneutralExplorer() {
|
||||
~moRandomBestHCExplorer() {
|
||||
delete current;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue