cz.cuni.sposhBot.java.examples
Class MyBehaviour
java.lang.Object
cz.cuni.sposhBot.java.JavaBehaviour
cz.cuni.sposhBot.java.examples.MyBehaviour
public class MyBehaviour
- extends JavaBehaviour
Here is the place to implement your acts and senses
The log domain of a behaviour is set to class name.
act:
in plan file: shoot
in behaviour: public void action_shoot()
sense:
in plan file: hear
in behaviour: public boolean sense_hear()
E.g. see action_doNothing() / sense_fail()
Constructor Summary |
MyBehaviour(java.lang.String name,
java.util.logging.Logger log,
SPoshBot bot)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
choosenItem
protected Item choosenItem
previousChoosenItem
protected Item previousChoosenItem
itemsToRunAround
public java.util.ArrayList<Item> itemsToRunAround
medkitsToRunAround
public java.util.ArrayList<Item> medkitsToRunAround
jumped
protected boolean jumped
medsRestart
protected boolean medsRestart
MyBehaviour
public MyBehaviour(java.lang.String name,
java.util.logging.Logger log,
SPoshBot bot)
action_rearm
public void action_rearm()
action_engageEnemy
public void action_engageEnemy()
action_runAroundCloseMeds
public void action_runAroundCloseMeds()
action_runAroundItems
public void action_runAroundItems()
action_runToItem
public void action_runToItem()
action_stopShooting
public void action_stopShooting()
action_jump
public void action_jump()
sense_fail
public boolean sense_fail()
- Overrides:
sense_fail
in class JavaBehaviour
sense_succeed
public boolean sense_succeed()
- Overrides:
sense_succeed
in class JavaBehaviour
sense_stucked
public boolean sense_stucked()
sense_isShooting
public boolean sense_isShooting()
sense_hasBetterWeapon
public boolean sense_hasBetterWeapon()
sense_health
public int sense_health()
sense_knowMedkits
public boolean sense_knowMedkits()
sense_armed
public boolean sense_armed()
sense_seeEnemy
public boolean sense_seeEnemy()
sense_seeItemAndWantIt
public boolean sense_seeItemAndWantIt()
chooseWeapon
private Weapon chooseWeapon()
- choose weapon according to the one he is currently holding
- has melee and see ranged => pick up ranged
- has ranged and see melee => pick up melee
- pick up first weapon he sees
- Returns:
- the choosen one weapon
chooseItem
private Item chooseItem()
- Reasoning about what to do with seen item
the easiest way of handeling it will be just to take it every time, but what should we do
when there are many of items laying in front of agent?
- choose weapon - choose the type he is lacking (melee/ranged)
- choose armor
- choose health - if the health is bellow normal maximum
- choose ammo - if it is suitable for possessed weapons
- ignore the item
seeAnyReachableItemAndWantIt
private boolean seeAnyReachableItemAndWantIt()
- sees reachable item and wants it
- Returns:
- true if there is an item which is useful for agent