Пример #1
0
 def compute_strategy(self, state, idteam, idplayer):
     mystate = toolbox.MyState(state, idteam, idplayer)
     if mystate.can_shoot():
         if (mystate.distanceToBall(mystate.my_but) < 60):
             return BDB.shootToGoal(mystate)
         if (self.attendre < 20):
             self.attendre += 1
             BDB.intercepter(mystate,
                             mystate.distanceToBall(mystate.my_but) * 0.65)
         if (mystate.closest(2)[0] and self.enplace < 3):
             self.enplace += 1
             return BDB.saligner(
                 mystate,
                 mystate.distanceToBall(mystate.adv_but) + 2)
         if (mystate.closest(2)[0] and self.enplace < 5
                 and self.enplace > 3):
             self.enplace += 1
             return BDB.saligner(
                 mystate,
                 mystate.distanceToBall(mystate.adv_but) + 1)
         self.enplace = 0
         return BDB.shootToGoal(mystate)
     if (mystate.closest(0)[0]
             or mystate.distanceToBall(mystate.my_but) < 60):
         return BDB.goToBallPredict(mystate)
     return BDB.intercepter(mystate,
                            mystate.distanceToBall(mystate.my_but) * 0.65)
Пример #2
0
 def compute_strategy(self, state, idteam, idplayer):
     mystate = toolbox.MyState(state, idteam, idplayer)
     if mystate.can_shoot():
         return BDB.shootToGoal(mystate)
     elif (mystate.my_position().distance(mystate.ball_position()) < 40
           and mystate.my_but.distance(mystate.ball_position()) < 90):
         return BDB.goToBallPredict(mystate)
     return BDB.intercepter(mystate, 20)
Пример #3
0
 def compute_strategy(self, state, idteam, idplayer):
     mystate = toolbox.MyState(state, idteam, idplayer)
     if mystate.can_shoot():
         if (mystate.imclosest() and self.enplace == 0):
             self.enplace = 1
             return BDB.saligner(
                 mystate,
                 mystate.distanceToBall(mystate.adv_but) + 2)
         self.enplace = 0
         return BDB.shootToGoal(mystate)
     if (mystate.mateclosest()):
         return BDB.saligner(mystate,
                             mystate.distanceToBall(mystate.adv_but) - 45)
     return BDB.goToBallPredict(mystate)
Пример #4
0
 def compute_strategy(self, state, idteam, idplayer):
     mystate = toolbox.MyState(state, idteam, idplayer)
     if mystate.can_shoot():
         if (mystate.distanceToBall(mystate.my_but) < 40):
             return BDB.shootEnA(mystate)
         if (mystate.imclosest() and self.enplace < 3):
             self.enplace += 1
             return BDB.saligner(
                 mystate,
                 mystate.distanceToBall(mystate.adv_but) + 2)
         if (mystate.imclosest() and self.enplace < 5 and self.enplace > 3):
             self.enplace += 1
             return BDB.saligner(
                 mystate,
                 mystate.distanceToBall(mystate.adv_but) + 1)
         self.enplace = 0
         return BDB.shootEnA(mystate)
     if ((mystate.imclosest())
             or mystate.distanceToBall(mystate.my_but) < 40):
         return BDB.goToBallPredict(mystate)
     return BDB.intercepter(mystate,
                            mystate.distanceToBall(mystate.my_but) * 0.65)
Пример #5
0
 def compute_strategy(self, state, idteam, idplayer):
     mystate = toolbox.MyState(state, idteam, idplayer)
     if mystate.can_shoot():
         return BDB.tirer(mystate)
     return BDB.goToBallPredict(mystate)