Examples of MazeCharacter


Examples of br.com.ema.maze.agents.MazeCharacter

  @Override
  public Maze buildMaze(MazeFile mazeFile) {
    Maze maze = new Maze();
    mazeConfiguration = new MazeConfiguration();
   
    MazeCharacter character1 = new MazeCharacter(250);
    character1.setStrategy(new AStarStrategy(10000));
    character1.setColor(Color.CYAN);
    mazeConfiguration.getCharacters().put("ASTAR",character1);

    MazeCharacter character2 = new MazeCharacter(250);
    character2.setStrategy(new GreedyStrategy());
    character2.setColor(Color.ORANGE);
    mazeConfiguration.getCharacters().put("GREEDY", character2);

   
    mazeConfiguration.setPassageAllowersInterval(1000);
   
View Full Code Here

Examples of br.com.ema.maze.agents.MazeCharacter

   
    maze.setExit(exitCoordinates);
    MazeSpace exit = maze.getSpace(exitCoordinates);
   
    for (String characterId : characters.keySet()) {
      MazeCharacter character = characters.get(characterId);
      maze.addCharacter(characterId, character);
     
      if (start != null){
        character.setActualSpace(start);
        start.putCharacter(character);
      }
     
      character.setDestination(exit);
    }
   
    if (passageAllowersInterval > 0){
      WallPassageAllowerAgent allower = new WallPassageAllowerAgent(passageAllowersInterval);
      maze.addWallPassageAllower(allower);
View Full Code Here

Examples of br.com.ema.maze.agents.MazeCharacter

  public void setupCharactersFromMazeParameters(MazeParameters mazeParameters){
    Map<String, MazeCharacter> characters = new HashMap<String, MazeCharacter>();
   
    List<MazeCharacterConfiguration> charactersConfigurations = mazeParameters.getCharactersConfigurations();
    for (MazeCharacterConfiguration characterConfiguration : charactersConfigurations) {
      MazeCharacter character = new MazeCharacter((Long) characterConfiguration.getConfiguration(ConfigurationType.ACTIONS_INTERVAL));
      character.setStrategy((MazeCharacterStrategy) characterConfiguration.getConfiguration(ConfigurationType.MAZE_CHARACTER_STRATEGY));
      character.setColor((Color) characterConfiguration.getConfiguration(ConfigurationType.COLOR));
      characters.put((String) characterConfiguration.getConfiguration(ConfigurationType.CHARACTER_ID), character);
    }

    setCharacters(characters);
  }
View Full Code Here

Examples of br.com.ema.maze.agents.MazeCharacter

  }
 
  @Test
  public void test_Get_Times_Passed_When_Never_Pass(){
    MazeSpace space = new MazeSpace(0,0);
    MazeCharacter character = new MazeCharacter(250);
   
    assertEquals(0, space.getTimesPassed(character));
  }
View Full Code Here

Examples of br.com.ema.maze.agents.MazeCharacter

  }
 
  @Test
  public void test_Get_Times_Passed(){
    MazeSpace space = new MazeSpace(0,0);
    MazeCharacter character = new MazeCharacter(250);
   
    space.putCharacter(character);
    space.putCharacter(character);
    space.putCharacter(character);
   
View Full Code Here

Examples of br.com.ema.maze.agents.MazeCharacter

  }
 
  @Test
  public void test_Get_Times_Passed_In_Interval(){
    MazeSpace space = new MazeSpace(0,0);
    MazeCharacter character = new MazeCharacter(250);
   
    space.putCharacter(character);
    space.putCharacter(character);
    space.putCharacter(character);
   
View Full Code Here

Examples of br.com.ema.maze.agents.MazeCharacter

    space23.addNearbySpace(space22, Direction.SOUTH);
   
    space13.addNearbySpace(space23, Direction.EAST);
    space23.addNearbySpace(space13, Direction.WEST);
   
    MazeCharacter character = new MazeCharacter(250);
    space13.putCharacter(character);
   
    assertEquals(space22, space12.getMinOriginalRoute(character, space23));
   
  }
View Full Code Here
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.