⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 serverandworker.java

📁 genetic algorithm with java
💻 JAVA
字号:
/*
 * This file is part of JGAP.
 *
 * JGAP offers a dual license model containing the LGPL as well as the MPL.
 *
 * For licencing information please see the file license.txt included with JGAP
 * or have a look at the top of class org.jgap.Chromosome which representatively
 * includes the JGAP license policy applicable for any file delivered with JGAP.
 */
package examples.grid.evolutionDistributed;

import org.apache.commons.cli.*;
import org.homedns.dade.jcgrid.cmd.*;
import org.homedns.dade.jcgrid.worker.*;
import org.jgap.distr.grid.*;

/**
 * Convenience call to start both the server and a worker at once. Only for
 * demonstration purposes. Normally, you would start the server and the
 * worker(s) separately and possibly on different hosts!<p>
 * This class can be used to start-up any JGAP grid, because the individual
 * data is only kept with the JGAPClient! The JGAPClient distributes any data
 * (including classes) necessary to the workers via the server.
 *
 * @author Klaus Meffert
 * @since 3.2
 */
public class ServerAndWorker {
  /** String containing the CVS revision. Read out via reflection!*/
  private final static String CVS_REVISION = "$Revision: 1.1 $";

  /**
   * Convenience (demo) start of both the server and a worker.
   *
   * @param args might not work here in this simple example as distinct options
   * between server and worker could lead to parsing errors.
   *
   * @throws Exception
   *
   * @author Klaus Meffert
   * @since 3.2
   */
  public static void main(String[] args)
      throws Exception {
    // Start server.
    // ------------
    new JGAPServer(args);
    // Setup worker configuration.
    // ---------------------------
    Options options = new Options();
    GridNodeWorkerConfig config = new GridNodeWorkerConfig();
    CommandLine cmd = MainCmd.parseCommonOptions(options, config, args);
    // Start worker.
    // -------------
    new JGAPWorkers(config);
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -