Examples of RoboterMove


Examples of ch.bfh.ti.kybernetik.engine.model.RoboterMove

  private void renderRoboterTrack(final Graphics g) {
    g.setColor(this.getColor());
    final Point2d oldPoint = new Point2d(-1, -1);
    Iterator<RoboterMove> it = moves.iterator();
    while (it.hasNext()) {
      RoboterMove roboterMoveState = it.next();
      if (oldPoint.getX() != -1) {
        g.drawLine((float) roboterMoveState.getNewRoboterPoint().getX(), (float) roboterMoveState.getNewRoboterPoint().getY(),
            (float) oldPoint.getX(), (float) oldPoint.getY());
      }
      oldPoint.setX(roboterMoveState.getNewRoboterPoint().getX());
      oldPoint.setY(roboterMoveState.getNewRoboterPoint().getY());
    }
  }
View Full Code Here

Examples of ch.bfh.ti.kybernetik.engine.model.RoboterMove

            }
            if (rightSensorIntensity == 0) {
              notifyObservers(new LightSensorModelObserverCommand(roboter, LightSensorCommandState.SENSOR_INTENSITY_REMAINS,
                  roboter.getRightLightSensor()));
            }
            RoboterMove rm = roboterController.calculateNewRoboterPosition(leftSensorIntensity, rightSensorIntensity);

            calculateOutOfWindowAreaPosition(roboterController, rm);

            notifyObservers(new RoboterMoveListModelObserverCommand(roboter,
                RoboterMoveModelObserverCommandState.ROBOTER_MOVE_ADDED, roboterController.getRoboterMoveHistory()));
View Full Code Here

Examples of ch.bfh.ti.kybernetik.engine.model.RoboterMove

    Vector2d topVektor = new Vector2d(rightSpeedPoint.getX() - leftSpeedPoint.getX(), rightSpeedPoint.getY() - leftSpeedPoint.getY());
    topVektor.normalize();
    Vector2d newDirectionVector = new Vector2d(topVektor.getY(), -topVektor.getX());

    RoboterMove rmove = new RoboterMove(roboter, newRoboterPoint, newDirectionVector);

    return rmove;
  }
View Full Code Here

Examples of ch.bfh.ti.kybernetik.engine.model.RoboterMove

    roboter.getLeftMotor().setVelocity(newLeftMotorSpeed);
    roboter.getRightMotor().setVelocity(newRightMotorSpeed);
    // END TODO

    final RoboterMove currentRoboterMoveState = calculateNextRoboterMove();

    this.roboterMoveStates.add(currentRoboterMoveState);
    roboter.setX(currentRoboterMoveState.getNewRoboterPoint().getX());
    roboter.setY(currentRoboterMoveState.getNewRoboterPoint().getY());
    roboter.setDirection(currentRoboterMoveState.getNewDirectionVector());
    return currentRoboterMoveState;
  }
View Full Code Here

Examples of ch.bfh.ti.kybernetik.engine.model.RoboterMove

  public List<RoboterMove> calculateNextEstimatedRoboterMoves(int count) {
    Roboter iterationRoboter = new Roboter(this.roboter);
    List<RoboterMove> estimatedRoboterMoveStates = new LinkedList<RoboterMove>();
    for (int i = 0; i < count; i++) {
      DefaultRoboterConstructionImpl constructionImpl = new DefaultRoboterConstructionImpl(iterationRoboter);
      RoboterMove roboterMoveState = calculateNextRoboterMove(constructionImpl);
      estimatedRoboterMoveStates.add(roboterMoveState);
      // Set new roboter data
      iterationRoboter.setX(roboterMoveState.getNewRoboterPoint().getX());
      iterationRoboter.setY(roboterMoveState.getNewRoboterPoint().getY());
      iterationRoboter.setDirection(roboterMoveState.getNewDirectionVector());
    }
    return estimatedRoboterMoveStates;
  }
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.