Documentation, add the method construct in AbstractTopology
This commit is contained in:
parent
631d693bef
commit
1c79ce0948
15 changed files with 90 additions and 392 deletions
|
|
@ -9,11 +9,14 @@ using namespace paradiseo::smp;
|
|||
|
||||
int main()
|
||||
{
|
||||
//Test of Complete Topology
|
||||
Topology<Complete> topo_comp;
|
||||
topo_comp.construct(5);
|
||||
int n;
|
||||
|
||||
std::cout << std::endl << "---------------" << std::endl << "Test of Complete Topology" << std::endl;
|
||||
//Test of Complete Topology
|
||||
n=5;
|
||||
Topology<Complete> topo_comp;
|
||||
topo_comp.construct(n);
|
||||
|
||||
std::cout << std::endl << "---------------" << std::endl << "Test of Complete Topology (" << n <<" islands) :"<<std::endl;
|
||||
|
||||
std::vector<unsigned> neighbors=topo_comp.getIdNeighbors(1);
|
||||
std::cout << "neighbors of Island 1 : "<<std::endl;
|
||||
|
|
@ -25,12 +28,24 @@ int main()
|
|||
for (int i=0; i < neighbors.size(); i++)
|
||||
std::cout << " " << neighbors[i];
|
||||
std::cout << std::endl;
|
||||
|
||||
//Re-construct Topology with different number of islands
|
||||
n=3;
|
||||
topo_comp.construct(n);
|
||||
neighbors=topo_comp.getIdNeighbors(2);
|
||||
std::cout <<"Changing number of islands to "<< n <<" : "<<std::endl;
|
||||
std::cout <<std::endl << "Neighbors of Island 2 : "<<std::endl;
|
||||
for (int i=0; i < neighbors.size(); i++)
|
||||
std::cout << " " << neighbors[i];
|
||||
std::cout << std::endl;
|
||||
|
||||
|
||||
//Test of Star Topology
|
||||
n=4;
|
||||
Topology<Star> topo_star;
|
||||
topo_star.construct(4);
|
||||
topo_star.construct(n);
|
||||
|
||||
std::cout << std::endl << "---------------" << std::endl << "Test of Star Topology" << std::endl;
|
||||
std::cout << std::endl << "---------------" << std::endl << "Test of Star Topology (" << n <<" islands) :" << std::endl;
|
||||
|
||||
neighbors=topo_star.getIdNeighbors(0);
|
||||
std::cout <<std::endl << "Neighbors of Island 0 : "<<std::endl;
|
||||
|
|
@ -45,10 +60,11 @@ int main()
|
|||
std::cout << std::endl;
|
||||
|
||||
//Test of Ring Topology
|
||||
n=8;
|
||||
Topology<Ring> topo_ring;
|
||||
topo_ring.construct(8);
|
||||
topo_ring.construct(n);
|
||||
|
||||
std::cout << std::endl << "---------------" << std::endl << "Test of Ring Topology" << std::endl;
|
||||
std::cout << std::endl << "---------------" << std::endl << "Test of Ring Topology (" << n <<" islands) :" << std::endl;
|
||||
|
||||
neighbors=topo_ring.getIdNeighbors(4);
|
||||
std::cout <<std::endl << "Neighbors of Island 4 : "<<std::endl;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue