Package eas.simulation.spatial.sim2D.standardEnvironments

Examples of eas.simulation.spatial.sim2D.standardEnvironments.WandaEnvironment


   * @return RGBPixel2D
   */
  @SuppressWarnings("rawtypes")
  public int getLineValue() {

    WandaEnvironment env = body.getEnvironment();

    Vector2D pos = new Vector2D(env.getAgentPosition(body.id()));
   
    //calculate offset
    Vector2D offsetLOV = env.getNormalizedLOV(body.id());
    offsetLOV.rotate(Vector2D.NULL_VECTOR, offset * Math.PI/2);
    offsetLOV.setLength(Math.abs(offset) * cOffset);
   
   
    //sensed point
    pos.translate(offsetLOV);

    float floor = env.getFloorPixelAt(pos).getGrayscale();
    float bg = Pixel2D_24Bit.getGraycale(env.getBackgroundColor().getRed(),
        env.getBackgroundColor().getGreen(), env.getBackgroundColor().getBlue());
   
    return Math.round((floor / bg) * 100);
  }
 
View Full Code Here


   * @see eas.simulation.AbstractDefaultMaster#generateEnvironments(eas.statistics.ParCollection)
   */
  @SuppressWarnings({ "unchecked" })
    @Override
  public WandaEnvironment[] generateRunnables(ParCollection params) {
    WandaEnvironment env = new WandaEnvironment(0, params);
   
    WandaAgent pointer = new WandaAgent(0, env, params);
    pointer.implantBrain(new MDL2eBrain<AbstractAgent2D<?>>(pointer,
        new File("eas/users/students/danielFunke/wandaTest/pointer.xml")));
    pointer.addActuator(new APOINTTO());
    env.addCollidingAgent(pointer, new Vector2D(-100,100), 0, null);
   
    WandaAgent mover = new WandaAgent(1, env, params);
    mover.implantBrain(new MDL2eBrain<AbstractAgent2D<?>>(mover,
        new File("eas/users/students/danielFunke/wandaTest/mover.xml")));
    mover.addActuator(new APOINTTO());
    env.addCollidingAgent(mover, Vector2D.NULL_VECTOR, 0, null);
   
    /*Random rand = new Random(params.getSeed());
        env.addScene(new ObstacleRectangularScene(1, params, rand));
   
    WandaAgent sensorTester = new WandaAgent(0, env, params);
View Full Code Here

TOP

Related Classes of eas.simulation.spatial.sim2D.standardEnvironments.WandaEnvironment

Copyright © 2018 www.massapicom. 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.