Package insects

Source Code of insects.InsectsMain

package insects;

import insects.AntHill;
import swarm.sim.*;
import swarm.viewer.*;

public class InsectsMain {
 
  private static final int numResources = 50;
 
  public static void main(String[] args){
   
    Sandbox terrain=new Sandbox(3200, 1800);
    Simulation sim=new Simulation(terrain);
   
    //Seeding the simulation
    sim.add(new AntHill(100,100));
    sim.add(new AntHill(3000,1600));
   
    for(int i=0; i<numResources;i++)
    {
      sim.add(new Resource(Math.random()*terrain.getWidth(),
           Math.random()*terrain.getHeight(), 20, 5));
     
    }
    for(int i=0; i<6; i++)
      sim.add(new Beetle(600, 1500));
    for(int i=0; i<18; i++)
      sim.add(new Wasp(2500, 400));
   
    sim.tick();
   
    ControlPanel controls=new ControlPanel(sim);
    new Viewer(controls);
   
  }
 
}
TOP

Related Classes of insects.InsectsMain

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.