ometah-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[oMetah-devel] ometah/interface ometah.cpp


From: Johann
Subject: [oMetah-devel] ometah/interface ometah.cpp
Date: Sat, 12 Mar 2005 17:39:16 -0500

CVSROOT:        /cvsroot/ometah
Module name:    ometah
Branch:         
Changes by:     Johann <address@hidden> 05/03/12 22:39:16

Modified files:
        interface      : ometah.cpp 

Log message:
        * all the steps from declaration to launch

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/ometah/ometah/interface/ometah.cpp.diff?tr1=1.3&tr2=1.4&r1=text&r2=text

Patches:
Index: ometah/interface/ometah.cpp
diff -u ometah/interface/ometah.cpp:1.3 ometah/interface/ometah.cpp:1.4
--- ometah/interface/ometah.cpp:1.3     Fri Mar 11 10:24:51 2005
+++ ometah/interface/ometah.cpp Sat Mar 12 22:39:15 2005
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  $Id: ometah.cpp,v 1.3 2005/03/11 10:24:51 nojhan Exp $
+ *  $Id: ometah.cpp,v 1.4 2005/03/12 22:39:15 nojhan Exp $
  *  Copyright : Université Paris 12 Val-de-Marne
  *  Author : Johann Dréo <address@hidden>
  ****************************************************************************/
@@ -41,10 +41,83 @@
     itsSet<itsCommunicationClient*> setCommunicationClient;
     itsSet<itsCommunicationServer*> setCommunicationServer;
 
-    // the factory
-    itsMetaheuristicFactory* factory;
+
+    /*
+     *  Metaheuristics part
+     */
+    
+    // the factory for metaheuristics
+    itsMetaheuristicFactory* factoryMetaheuristics;
 
     // add the estimation of distribution algorithm
-    factory = new itsEstimationOfDistributionFactory;
-    setMetaheuristic.add( factory->create() );
+    factoryMetaheuristics = new itsEstimationOfDistributionFactory;
+    setMetaheuristic.add( factoryMetaheuristics->create() );
+
+
+    /*
+     *  Problems part
+     */
+    
+    // the factory for problems
+    itsProblemFactory* factoryProblems;
+    
+    // add Rosenbrock
+    factoryProblems = new itsRosenbrockFactory;
+    setProblem.add( factoryProblems->create() );
+    
+    
+    /*
+     *  Communication part
+     */
+      
+    // the factory for communication client
+    itsCommunicationClientFactory * factoryClient;
+    itsCommunicationServerFactory * factoryServer;
+    
+    // add the embedded protocol
+    factoryClient = new itsCommunicationClientFactory_embedded;
+    setCommunicationClient.add( factoryClient->create() );
+    
+    factoryServer = new itsCommunicationServerFactory_embedded;
+    setCommunicationServer.add( factoryServer->create() );
+
+
+    /* 
+     *  Choose the items
+     */
+    
+    setMetaheuristic.choose("CEDA");
+    setProblem.choose("Rosenbrock");
+    setCommunicationClient.choose("Embedded");
+    setCommunicationServer.choose("Embedded");
+    
+    
+    /*
+     *  Links
+     *  Warning : be sure to do the "choose" step before
+     */
+    
+    // metaheuristic -> client
+    setMetaheuristic.item()->problem = setCommunicationClient.item();
+    
+    // server -> problem
+    setCommunicationServer.item()->problem = setProblem.item();
+    
+    
+    /*
+     *  Parameter setting
+     */
+    
+    // Special case for the embedded protocol : we must link client and server
+    if( setMetaheuristic.item()->getKey() == "Embedded" ) {
+        setCommunicationClient.item()->link = setCommunicationServer.item();
+    }
+    
+    
+    /*
+     *  Launch the optimization
+     */
+    
+    setMetaheuristic.item()->start();
+    
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]