Package fr.utbm.gi.vi51.pw

Source Code of fr.utbm.gi.vi51.pw.MainProgram

/*
* $Id$
*
* Copyright (C) 2007-2011 Stephane Galland <stephane.galland@utbm.fr>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
package fr.utbm.gi.vi51.pw;

import javax.swing.JOptionPane;

import org.janusproject.kernel.locale.LocalizedString;

import fr.utbm.gi.vi51.framework.FrameworkLauncher;
import fr.utbm.gi.vi51.framework.environment.Environment;
import fr.utbm.gi.vi51.framework.gui.FrameworkGUI;
import fr.utbm.gi.vi51.pw.agent.Lemming;
import fr.utbm.gi.vi51.pw.environment.WorldModel;
import fr.utbm.gi.vi51.pw.gui.GUI;

/**
* @author St&eacute;phane GALLAND &lt;stephane.galland@utbm.fr&gt;
* @version $Name$ $Revision$ $Date$
*/
public class MainProgram {

  private static double WORLD_SIZE_X = 700;
  private static double WORLD_SIZE_Y = 700;
  private static long EXECUTION_DELAY = 50;
 
  /** Main program.
   *
   * @param argv are the command line arguments.
   */ 
  public static void main(String[] argv) {
   
    System.out.println(LocalizedString.get(MainProgram.class, "INTRO_MESSAGE")); //$NON-NLS-1$
   
    boolean steering = JOptionPane.showConfirmDialog(null,
        LocalizedString.get(MainProgram.class, "USE_STEERING_MESSAGE"), //$NON-NLS-1$
        LocalizedString.get(MainProgram.class, "USE_STEERING_TITLE"), //$NON-NLS-1$
        JOptionPane.YES_NO_OPTION,
        JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION;

    FrameworkGUI gui = new GUI(WORLD_SIZE_X, WORLD_SIZE_Y);
   
    Environment environment = new WorldModel(WORLD_SIZE_X, WORLD_SIZE_Y);
   
    FrameworkLauncher.launchEnvironment(environment, gui, EXECUTION_DELAY);

    Lemming a = new Lemming(steering) ;   
    FrameworkLauncher.launchAgent(a) ;

    Lemming b = new Lemming(steering) ;
    FrameworkLauncher.launchAgent(b) ;

    Lemming c = new Lemming(steering) ;
    FrameworkLauncher.launchAgent(c) ;

    Lemming d = new Lemming(steering) ;
    FrameworkLauncher.launchAgent(d) ;
   
    FrameworkLauncher.startSimulation();
  }

}
TOP

Related Classes of fr.utbm.gi.vi51.pw.MainProgram

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.