Package net.javlov.world

Examples of net.javlov.world.Body


  }
 
  protected void makeWorld() {
    world = new GridLimitedOptionsWorld(15, 18, cellwidth, cellheight);
   
    Body landmark = new Phys2DBody( new StaticBox(cellwidth, cellheight), 10, true );
    landmark.setLocation(4.5*cellwidth, 14.5*cellheight);
    landmark.setType(Body.UNDEFINED);
    world.addFixedBody(landmark);
   
    landmark = new Phys2DBody( new StaticBox(cellwidth, cellheight), 10, true );
    landmark.setLocation(4.5*cellwidth, 8.5*cellheight);
    landmark.setType(Body.UNDEFINED);
    world.addFixedBody(landmark);
   
    landmark = new Phys2DBody( new StaticBox(cellwidth, cellheight), 10, true );
    landmark.setLocation(10.5*cellwidth, 8.5*cellheight);
    landmark.setType(Body.UNDEFINED);
    world.addFixedBody(landmark);
   
    landmark = new Phys2DBody( new StaticBox(cellwidth, cellheight), 10, true );
    landmark.setLocation(10.5*cellwidth, 2.5*cellheight);
    landmark.setType(Body.UNDEFINED);
    world.addFixedBody(landmark);
   
    rf = new GridRewardFunction();
    world.setRewardFunction(rf);
    world.addCollisionListener(rf);
View Full Code Here


    return occupiers;
  }
 
  @Override
  public boolean remove(Agent a) {
    Body b = agentBodyMap.get(a);
    if ( removeBody(b) )
      return (agentBodyMap.remove(a) == null ? false : true);
    return false;
  }
View Full Code Here

    this.speed = speed;
  }
 
  @Override
  public void execute(Agent a) {
    Body b = world.getAgentBody(a);
    world.translateBody(b, dir, speed);   
  }
View Full Code Here

TOP

Related Classes of net.javlov.world.Body

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.