|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.udk.agent.module.sensor.AdvancedItems
public class AdvancedItems
Module specialized on items on the map. This module extends the Items
module by adding filters for usability and/or "takeability". These filters may
help the agent to decide, whether it is useful for him, to forage specific
items from the map.
You have to provide the implementation of IItemUsefulness
interface
where you have to specify what usefulness is.
Note that it might be useful to instantiate this class multiple times with different item filters to achieve various specialized filters (e.g., different useful filter for weapons and health).
It is designed to be initialized inside IUDKBotController.initializeController(UDKBot)
method call
and may be used since IUDKBotController.botInitialized(cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.InitedMessage)
is called.
Constructor Summary | |
---|---|
AdvancedItems(Items items,
IItemUsefulness filter)
Constructor. |
|
AdvancedItems(UDKBot bot,
IItemUsefulness filter)
Constructor. |
Method Summary | |
---|---|
Map<UnrealId,Item> |
filterUsefulItems(Collection<Item> items,
double usefulness)
Determines, whether an item can be useful for the agent. |
Map<UnrealId,Item> |
getAllItems(double usefulness)
Retrieves map of all items (both known and thrown). |
Map<UnrealId,Item> |
getAllItems(ItemType.Category category,
double usefulness)
Retrieves map of all items of specific category (both known and thrown). |
Map<UnrealId,Item> |
getAllItems(ItemType.Group group,
double usefulness)
Retrieves map of all items of specific group (both known and thrown). |
Map<UnrealId,Item> |
getAllItems(ItemType type,
double usefulness)
Retrieves map of all items of specific type (both known and thrown). |
Items |
getItems()
Returns underlying Items module. |
Map<UnrealId,Item> |
getKnownPickups(double usefulness)
Retrieves map of all item pickup points. |
Map<UnrealId,Item> |
getKnownPickups(ItemType.Category category,
double usefulness)
Retrieves map of all item pickup points of items of a specific category. |
Map<UnrealId,Item> |
getKnownPickups(ItemType.Group group,
double usefulness)
Retrieves map of all item pickup points of items of a specific group. |
Map<UnrealId,Item> |
getKnownPickups(ItemType type,
double usefulness)
Retrieves map of all item pickup points of items of a specific type. |
Map<UnrealId,Item> |
getReachableItems(double usefulness)
Retrieves map of all reachable items. |
Map<UnrealId,Item> |
getReachableItems(ItemType.Category category,
double usefulness)
Retrieves map of all reachable items of a specific category. |
Map<UnrealId,Item> |
getReachableItems(ItemType.Group group,
double usefulness)
Retrieves map of all reachable items of a specific group. |
Map<UnrealId,Item> |
getReachableItems(ItemType type,
double usefulness)
Retrieves map of all reachable items of a specific type. |
Map<UnrealId,Item> |
getSpawnedItems(double usefulness)
Returns a filtered list of items that are guessed to be currently spawned in the map. |
Map<UnrealId,Item> |
getSpawnedItems(ItemType.Category category,
double usefulness)
Returns a filtered list of items of a specific category that are guessed to be currently spawned in the map. |
Map<UnrealId,Item> |
getSpawnedItems(ItemType.Group group,
double usefulness)
Returns a filtered list of items of a specific group that are guessed to be currently spawned in the map. |
Map<UnrealId,Item> |
getSpawnedItems(ItemType type,
double usefulness)
Returns a filtered list of items of a specific type that are guessed to be currently spawned in the map. |
Map<UnrealId,Item> |
getVisibleItems(double usefulness)
Retrieves map of all visible items. |
Map<UnrealId,Item> |
getVisibleItems(ItemType.Category category,
double usefulness)
Retrieves map of all visible items of specific category. |
Map<UnrealId,Item> |
getVisibleItems(ItemType.Group group,
double usefulness)
Retrieves map of all visible items of specific group. |
Map<UnrealId,Item> |
getVisibleItems(ItemType type,
double usefulness)
Retrieves map of all visible items of specific type. |
boolean |
isItemUseful(Item item,
double usefulness)
Determines, whether an item can be useful for the agent. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AdvancedItems(UDKBot bot, IItemUsefulness filter)
bot
- owner of the modulefilter
- the filter of the usefulnesspublic AdvancedItems(Items items, IItemUsefulness filter)
items
- items memory modulefilter
- the filter of the usefulnessMethod Detail |
---|
public Map<UnrealId,Item> getSpawnedItems(double usefulness)
WARNING: O(n) complexity!
This implementation is guessing (optimistically) whether the item is spawned based on the last time we have seen it missing (saw its navpoint but the item was not laying there).
Note that the guessing is not perfect, experiment with it or check the source code and possibly reimplement to suit your needs.
Note that this method is working only if items are respawning.
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
public Map<UnrealId,Item> getSpawnedItems(ItemType type, double usefulness)
WARNING: O(n) complexity!
This implementation is guessing (optimistically) whether the item is spawned based on the last time we have seen it missing (saw its navpoint but the item was not laying there).
Note that the guessing is not perfect, experiment with it or check the source code and possibly reimplement to suit your needs.
Note that this method is working only if items are respawning.
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
public Map<UnrealId,Item> getSpawnedItems(ItemType.Category category, double usefulness)
WARNING: O(n) complexity!
This implementation is guessing (optimistically) whether the item is spawned based on the last time we have seen it missing (saw its navpoint but the item was not laying there).
Note that the guessing is not perfect, experiment with it or check the source code and possibly reimplement to suit your needs.
Note that this method is working only if items are respawning.
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
public Map<UnrealId,Item> getSpawnedItems(ItemType.Group group, double usefulness)
WARNING: O(n) complexity!
This implementation is guessing (optimistically) whether the item is spawned based on the last time we have seen it missing (saw its navpoint but the item was not laying there).
Note that the guessing is not perfect, experiment with it or check the source code and possibly reimplement to suit your needs.
Note that this method is working only if items are respawning.
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
public Map<UnrealId,Item> getAllItems(double usefulness)
WARNING: O(n) complexity!
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
public Map<UnrealId,Item> getAllItems(ItemType type, double usefulness)
WARNING: O(n) complexity!
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
public Map<UnrealId,Item> getAllItems(ItemType.Category category, double usefulness)
WARNING: O(n) complexity!
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
public Map<UnrealId,Item> getAllItems(ItemType.Group group, double usefulness)
WARNING: O(n) complexity!
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
public Map<UnrealId,Item> getVisibleItems(double usefulness)
WARNING: O(n) complexity!
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
public Map<UnrealId,Item> getVisibleItems(ItemType type, double usefulness)
WARNING: O(n) complexity!
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
public Map<UnrealId,Item> getVisibleItems(ItemType.Category category, double usefulness)
WARNING: O(n) complexity!
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
public Map<UnrealId,Item> getVisibleItems(ItemType.Group group, double usefulness)
WARNING: O(n) complexity!
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
public Map<UnrealId,Item> getReachableItems(double usefulness)
WARNING: O(n) complexity!
WARNING:It is totally unclear what UT2004 means by reachable!!!
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
public Map<UnrealId,Item> getReachableItems(ItemType type, double usefulness)
WARNING: O(n) complexity!
WARNING:It is totally unclear what UT2004 means by reachable!!!
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
public Map<UnrealId,Item> getReachableItems(ItemType.Category category, double usefulness)
WARNING: O(n) complexity!
WARNING:It is totally unclear what UT2004 means by reachable!!!
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
public Map<UnrealId,Item> getReachableItems(ItemType.Group group, double usefulness)
WARNING: O(n) complexity!
WARNING:It is totally unclear what UT2004 means by reachable!!!
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
public Map<UnrealId,Item> getKnownPickups(double usefulness)
WARNING: O(n) complexity!
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
isPickupSpawned(Item)
public Map<UnrealId,Item> getKnownPickups(ItemType type, double usefulness)
WARNING: O(n) complexity!
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
isPickupSpawned(Item)
public Map<UnrealId,Item> getKnownPickups(ItemType.Category category, double usefulness)
WARNING: O(n) complexity!
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
isPickupSpawned(Item)
public Map<UnrealId,Item> getKnownPickups(ItemType.Group group, double usefulness)
WARNING: O(n) complexity!
usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
isPickupSpawned(Item)
public boolean isItemUseful(Item item, double usefulness)
item
- Given item to be checked.usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
public Map<UnrealId,Item> filterUsefulItems(Collection<Item> items, double usefulness)
WARNING: O(n) complexity!
items
- Items to be filtered on.usefulness
- degree of usefulness, 0 - return also useless, 1 - return only really truly useful items which are MUST HAVE!
public Items getItems()
Items
module.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |