Package transientlibs.rlforj.examples

Source Code of transientlibs.rlforj.examples.ConeFovExample

package transientlibs.rlforj.examples;

import java.util.Random;

import transientlibs.rlforj.los.ConePrecisePremisive;
import transientlibs.rlforj.los.IConeFovAlgorithm;
import transientlibs.rlforj.los.ShadowCasting;

public class ConeFovExample
{

  public static void main(String[] args)
  {
    ExampleBoard b = new ExampleBoard(21, 21);
    Random rand=new Random();
    for(int i=0; i<30; i++) {
      b.setObstacle(rand.nextInt(21), rand.nextInt(21));
    }
//    int startAngle=rand.nextInt(360), finishAngle=rand.nextInt(360);
    int startAngle=30, finishAngle=70;
    System.out.println(startAngle+" degrees to "+finishAngle+" degrees");
    System.out.println("ShadowCasting");
    IConeFovAlgorithm a=new ShadowCasting();
    a.visitConeFieldOfView(b, 10, 10, 9, startAngle, finishAngle);
    b.print(10, 10);
   
    b.resetVisitedAndMarks();
    System.out.println("Precise Permissive");
    a=new ConePrecisePremisive();
    a.visitConeFieldOfView(b, 10, 10, 10, startAngle, finishAngle);
    b.print(10, 10);
  }
}
TOP

Related Classes of transientlibs.rlforj.examples.ConeFovExample

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.