class Plan

Public Class Methods

new() click to toggle source
# File plan/plan.rb, line 23
def initialize
  puts "Initializing!"
  @agentModel = Java::sk.fiit.jim.agent.models.AgentModel.getInstance
      @agentInfo = Java::sk.fiit.jim.agent.AgentInfo.getInstance
      @tacticalInfo = Java::sk.fiit.jim.agent.models.TacticalInfo.getInstance
      @Angles = Java::sk.fiit.robocup.library.geometry.Angles
  @formationPosition    = @tacticalInfo.getFormPositionGlobal()
  @plan = []
  @queue = []
  @names = []
  @turned = false
  @beamed = false
end

Public Instance Methods

ball_back?() click to toggle source
# File plan/plan.rb, line 67
def ball_back?
      @agentInfo.getWhereIsBall.eql? 'back'
end
ball_front?() click to toggle source
# File plan/plan.rb, line 63
def ball_front?
      @agentInfo.getWhereIsBall.eql? 'front'       
end
ball_unseen() click to toggle source
# File plan/plan.rb, line 87
def ball_unseen
  EnvironmentModel.SIMULATION_TIME - WorldModel.getInstance.getBall.getLastTimeSeen()
end
change_skill(move_name) click to toggle source
# File plan/plan.rb, line 15
def change_skill move_name 
   @queue.clear
   @queue << LowSkill.new(move_name)
end
closest_to_ball?() click to toggle source
# File plan/plan.rb, line 83
def closest_to_ball?
  return true
end
control() click to toggle source
# File plan/plan.rb, line 37
def control
      if @plan.empty? or @plan[0].isEnded()
              replan
  end
  
        unless @plan.empty?
          @plan[0].execute
  end
end
is_ball_mine?() click to toggle source
# File plan/plan.rb, line 71
def is_ball_mine?
      return @agentInfo.isBallMine
end
near_ball?() click to toggle source
# File plan/plan.rb, line 79
def near_ball?
      return @agentInfo.getNearBall
end
replan() click to toggle source
# File plan/plan.rb, line 47
def replan
end
reset() click to toggle source
# File plan/plan.rb, line 50
def reset
      @plan.clear
      @beamed = false
end
see_ball?() click to toggle source
# File plan/plan.rb, line 59
def see_ball?
      ball.notSeenLongTime() < 5
end
straight?() click to toggle source
# File plan/plan.rb, line 75
def straight?
  @@straight_range1.include?(@target_position_phi) or @@straight_range2.include?(@target_position_phi)
end
turned_to_goal?() click to toggle source
# File plan/plan.rb, line 55
def turned_to_goal?
      @@straight_range1.include?( @kick_target_phi) or @@straight_range2.include?( @kick_target_phi)
end