add topologies
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@985 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
335ed56a9d
commit
db913f147a
8 changed files with 345 additions and 1 deletions
|
|
@ -26,7 +26,10 @@ SET (CORE_SOURCES peo_init.cpp
|
|||
runner.cpp
|
||||
communicable.cpp
|
||||
topology.cpp
|
||||
ring_topo.cpp)
|
||||
ring_topo.cpp
|
||||
star_topo.cpp
|
||||
random_topo.cpp
|
||||
complete_topo.cpp)
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
53
trunk/paradiseo-peo/src/core/complete_topo.cpp
Normal file
53
trunk/paradiseo-peo/src/core/complete_topo.cpp
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* <complete_topo.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
|
||||
* (C) OPAC Team, LIFL, 2002-2007
|
||||
*
|
||||
* Sebastien Cahon, Alexandru-Adrian Tantar
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
|
||||
#include <cassert>
|
||||
#include "complete_topo.h"
|
||||
|
||||
void CompleteTopology :: setNeighbors (Cooperative * __mig,
|
||||
std :: vector <Cooperative *> & __from,
|
||||
std :: vector <Cooperative *> & __to) {
|
||||
|
||||
__from.clear () ;
|
||||
__to.clear () ;
|
||||
|
||||
for (int i = 0; i < mig.size (); i ++) {
|
||||
if (mig [i] != __mig) {
|
||||
__from.push_back (mig [i]);
|
||||
__to.push_back (mig [i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
51
trunk/paradiseo-peo/src/core/complete_topo.h
Normal file
51
trunk/paradiseo-peo/src/core/complete_topo.h
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* <complete_topo.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
|
||||
* (C) OPAC Team, LIFL, 2002-2007
|
||||
*
|
||||
* Sebastien Cahon, Alexandru-Adrian Tantar
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __complete_topo_h
|
||||
#define __complete_topo_h
|
||||
|
||||
#include "topology.h"
|
||||
|
||||
class CompleteTopology : public Topology {
|
||||
|
||||
public :
|
||||
|
||||
void setNeighbors (Cooperative * __mig,
|
||||
std :: vector <Cooperative *> & __from,
|
||||
std :: vector <Cooperative *> & __to);
|
||||
};
|
||||
|
||||
#endif
|
||||
55
trunk/paradiseo-peo/src/core/random_topo.cpp
Normal file
55
trunk/paradiseo-peo/src/core/random_topo.cpp
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* <random_topo.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
|
||||
* (C) OPAC Team, LIFL, 2002-2007
|
||||
*
|
||||
* Sebastien Cahon, Alexandru-Adrian Tantar
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
|
||||
#include <cassert>
|
||||
#include "random_topo.h"
|
||||
|
||||
#include <utils/eoRNG.h>
|
||||
|
||||
void RandomTopology :: setNeighbors (Cooperative * __mig,
|
||||
std :: vector <Cooperative *> & __from,
|
||||
std :: vector <Cooperative *> & __to) {
|
||||
|
||||
__from.clear () ;
|
||||
__to.clear () ;
|
||||
|
||||
for (int i = 0; i < mig.size (); i ++) {
|
||||
if (mig [i] != __mig && rng.uniform() < 0.5 ) {
|
||||
__from.push_back (mig [i]);
|
||||
__to.push_back (mig [i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
51
trunk/paradiseo-peo/src/core/random_topo.h
Normal file
51
trunk/paradiseo-peo/src/core/random_topo.h
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* <random_topo.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
|
||||
* (C) OPAC Team, LIFL, 2002-2007
|
||||
*
|
||||
* Sebastien Cahon, Alexandru-Adrian Tantar
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __random_topo_h
|
||||
#define __random_topo_h
|
||||
|
||||
#include "topology.h"
|
||||
|
||||
class RandomTopology : public Topology {
|
||||
|
||||
public :
|
||||
|
||||
void setNeighbors (Cooperative * __mig,
|
||||
std :: vector <Cooperative *> & __from,
|
||||
std :: vector <Cooperative *> & __to);
|
||||
};
|
||||
|
||||
#endif
|
||||
69
trunk/paradiseo-peo/src/core/star_topo.cpp
Normal file
69
trunk/paradiseo-peo/src/core/star_topo.cpp
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* <star_topo.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
|
||||
* (C) OPAC Team, LIFL, 2002-2007
|
||||
*
|
||||
* Sebastien Cahon, Alexandru-Adrian Tantar
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
|
||||
#include <cassert>
|
||||
#include "star_topo.h"
|
||||
|
||||
StarTopology :: StarTopology () : center( NULL ) {}
|
||||
|
||||
void StarTopology :: setNeighbors (Cooperative * __mig,
|
||||
std :: vector <Cooperative *> & __from,
|
||||
std :: vector <Cooperative *> & __to) {
|
||||
|
||||
assert( center != NULL );
|
||||
|
||||
__from.clear () ;
|
||||
__to.clear () ;
|
||||
|
||||
if ( __mig == center ) {
|
||||
|
||||
for (int i = 0; i < mig.size (); i ++) {
|
||||
if (mig [i] != center) {
|
||||
__from.push_back (mig [i]);
|
||||
__to.push_back (mig [i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
__from.push_back (center);
|
||||
__to.push_back (center);
|
||||
}
|
||||
}
|
||||
|
||||
void StarTopology :: setCenter (Cooperative& __center) {
|
||||
|
||||
center = &__center;
|
||||
}
|
||||
59
trunk/paradiseo-peo/src/core/star_topo.h
Normal file
59
trunk/paradiseo-peo/src/core/star_topo.h
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* <star_topo.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
|
||||
* (C) OPAC Team, LIFL, 2002-2007
|
||||
*
|
||||
* Sebastien Cahon, Alexandru-Adrian Tantar
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __star_topo_h
|
||||
#define __star_topo_h
|
||||
|
||||
#include "topology.h"
|
||||
|
||||
class StarTopology : public Topology {
|
||||
|
||||
public :
|
||||
|
||||
StarTopology ();
|
||||
|
||||
void setNeighbors (Cooperative * __mig,
|
||||
std :: vector <Cooperative *> & __from,
|
||||
std :: vector <Cooperative *> & __to);
|
||||
|
||||
void setCenter (Cooperative& __center);
|
||||
|
||||
private :
|
||||
|
||||
Cooperative* center;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -335,6 +335,9 @@
|
|||
|
||||
/* Cooperative island model */
|
||||
#include "core/ring_topo.h"
|
||||
#include "core/star_topo.h"
|
||||
#include "core/random_topo.h"
|
||||
#include "core/complete_topo.h"
|
||||
#include "peoData.h"
|
||||
#include "peoSyncIslandMig.h"
|
||||
#include "peoAsyncIslandMig.h"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue