- Main Page
- Namespaces
- Classes
- Files

- Search for |

# ring_topo.cpp

    00001 // "ring_topo.cpp"
    00002
    00003 // (c) OPAC Team, LIFL, September 2005
    00004
    00005 /*
    00006    Contact: paradiseo-help@lists.gforge.inria.fr
    00007 */
    00008
    00009 #include "ring_topo.h"
    00010
    00011 void RingTopology :: setNeighbors (Cooperative * __mig,
    00012                                    std :: vector <Cooperative *> & __from,
    00013                                    std :: vector <Cooperative *> & __to) {
    00014   __from.clear () ;
    00015   __to.clear () ;
    00016
    00017     int len = mig.size () ;
    00018
    00019     for (int i = 0 ; i < len ; i ++)
    00020       if (mig [i] == __mig) {
    00021         __from.push_back (mig [(i - 1 + len) % len]) ;
    00022         __to.push_back (mig [(i + 1) % len]) ;
    00023         break;
    00024       }
    00025 }