Package cz.cuni.mff.abacs.burglar.logics.planning.instructions

Examples of cz.cuni.mff.abacs.burglar.logics.planning.instructions.Instruction


    if(a.size() != b.size()){
      return false;
    }
   
    for(int i = 0; i < a.size(); i++){
      Instruction instrA = a.get(i);
      Instruction instrB = b.get(i);
      if(instrA.matches(instrB) == false)
        return false;
    }
   
    return true;
View Full Code Here


      Instruction instruction,
      Agent testAgent
  ) {
    List<Instruction> result = new ArrayList<Instruction>();
   
    Instruction simpleInstr;
   
    switch(instruction._code){
      case ENTER_DOOR:
        simpleInstr =
          new Instruction(
              Instruction.code.MOVE,
              instruction._agentId,
              instruction._subjectId
          );
        result.add(simpleInstr);
        testAgent.setPosition(instruction._subjectId);
        break;
       
      case COMPLEX_MOVE:
        Position subjectPos = this.getPosition(instruction._subjectId);
        if(subjectPos == null)
          subjectPos = this.getAgent(instruction._subjectId).getPosition();
        List<Position> path =
            this.getSimplePath(
              testAgent.getPosition(),
              subjectPos
            );
       
        for(Position position : path){
          simpleInstr =
            new Instruction(
                Instruction.code.MOVE,
                instruction._agentId,
                position.getId()
            );
          result.add(simpleInstr);
View Full Code Here

   
    switch(code){
    case COMPLEX_MOVE:
      int moveToId = Integer.parseInt(words[4].substring(1));
     
      instructions.add(new Instruction(code, agentId, moveToId));
      return false;
    case ENTER_DOOR:
      int doorId = Integer.parseInt(words[3].substring(1));
     
      instructions.add(new Instruction(code, agentId, doorId));
      return true;
    case OPEN:
    case CLOSE:
    case USE:
      positionId = Integer.parseInt(words[3].substring(1));
     
      instructions.add(new Instruction(code, agentId, positionId));
      return false;
    case UNLOCK:
    case LOCK:
    case PICK_UP:
      positionId = Integer.parseInt(words[3].substring(1));
      int itemId = Integer.parseInt(words[4].substring(1));
     
      instructions.add(
          new Instruction(code, agentId, positionId, itemId)
      );
      return false;
    default:
     
    }
View Full Code Here

   
    switch(code){
    case COMPLEX_MOVE:
      int moveToId = Integer.parseInt(words[4].substring(1));
     
      instructions.add(new Instruction(code, agentId, moveToId));
      return false;
    case ENTER_DOOR:
      int doorId = Integer.parseInt(words[3].substring(1));
     
      instructions.add(new Instruction(code, agentId, doorId));
      return true;
    case OPEN:
    case CLOSE:
    case USE:
      positionId = Integer.parseInt(words[3].substring(1));
     
      instructions.add(new Instruction(code, agentId, positionId));
      return false;
    case UNLOCK:
    case LOCK:
    case PICK_UP:
      positionId = Integer.parseInt(words[3].substring(1));
      int itemId = Integer.parseInt(words[4].substring(1));
     
      instructions.add(
          new Instruction(code, agentId, positionId, itemId)
      );
      return false;
    case TAKE_CLOTHES:
      positionId = Integer.parseInt(words[3].substring(1));
     
      instructions.add(
          new Instruction(code, agentId, positionId)
      );
      return false;
    default:
     
    }
View Full Code Here

   
    switch(code){
    case COMPLEX_MOVE:
      int moveToId = Integer.parseInt(params.get(2));
     
      instructions.add(new Instruction(code, agentId, moveToId));
      return false;
    case ENTER_DOOR:
      int doorId = Integer.parseInt(params.get(1));
     
      instructions.add(new Instruction(code, agentId, doorId));
      return true;
    case OPEN:
    case CLOSE:
    case USE:
      positionId = Integer.parseInt(params.get(1));
     
      instructions.add(new Instruction(code, agentId, positionId));
      return false;
    case UNLOCK:
    case LOCK:
    case PICK_UP:
      positionId = Integer.parseInt(params.get(1));
      int itemId = Integer.parseInt(params.get(2));
     
      instructions.add(
          new Instruction(code, agentId, positionId, itemId)
      );
      return false;
    default:
     
    }
View Full Code Here

TOP

Related Classes of cz.cuni.mff.abacs.burglar.logics.planning.instructions.Instruction

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.