decisionMakingSystem
Class ThingsManager

Package class diagram package ThingsManager
java.lang.Object
  extended by decisionMakingSystem.ThingsManager

public class ThingsManager
extends Object

register listeners for items, players etc. handles them and add to them affordances etc. also manages list of all items and operations over it - most important action for other parts of DMS is seeingItems, which add to perceptive field items of an affordance agent is looking for

Author:
Ondrej

Field Summary
 HashMap<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId,Long> idTable
           
 HashMap<Long,EItem> visibleItems
          visible items - by unique integer ID
 
Constructor Summary
ThingsManager(Bot agent, Logger log, PerceptiveField field, String directory, DecisionModuleImpl decisionModule)
           
 
Method Summary
 void everyRoundUpdate(int counter)
           
 ArrayList<EItem> getItemOfAffordance(AffordanceType aff)
          used for instance in the increaseAttractivityToAllSources in perceptive field gets an item of provided AffordanceType
 boolean isNight()
           
 boolean isReady()
           
static void main(String[] args)
          just for testing - creates file with item parameters and verifies, that it is correct
static void makeFirstEntry(String fileName)
          saves example of itemParameters to xml file to have a sample of itemParameters.xml
 int probability(EItem newItem)
          it counts the probability, item will be spoted by agent - probability is based on stress as well - about a time to get some idea how this work:)
 EItem processItem(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Item item)
          process Item to EItem
 EItem processItem(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ItemPickedUp item)
          process AddItem to EItem - needed by inventory for instance
 EItem processItem(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.NavPoint item)
          process NavPoint to EItem
 EItem processItem(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player item)
          process player to EItem
 EItem seeingItem(AffordanceType affordance)
          called from SearchEnvironment as well as from SearchRandom again a little bit of a dark magic, so look at it closely, study Klara's bachelor thesis
 void setReady(boolean ready)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

visibleItems

public final HashMap<Long,EItem> visibleItems
visible items - by unique integer ID


idTable

public HashMap<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId,Long> idTable
Constructor Detail

ThingsManager

public ThingsManager(Bot agent,
                     Logger log,
                     PerceptiveField field,
                     String directory,
                     DecisionModuleImpl decisionModule)
Method Detail

isNight

public boolean isNight()

everyRoundUpdate

public void everyRoundUpdate(int counter)

processItem

public EItem processItem(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Item item)
process Item to EItem

Parameters:
item -
Returns:

processItem

public EItem processItem(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ItemPickedUp item)
process AddItem to EItem - needed by inventory for instance

Parameters:
item -
Returns:

processItem

public EItem processItem(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.NavPoint item)
process NavPoint to EItem

Parameters:
item -
Returns:

processItem

public EItem processItem(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player item)
process player to EItem

Parameters:
item -
Returns:

makeFirstEntry

public static void makeFirstEntry(String fileName)
saves example of itemParameters to xml file to have a sample of itemParameters.xml


main

public static void main(String[] args)
just for testing - creates file with item parameters and verifies, that it is correct

Parameters:
args -

probability

public int probability(EItem newItem)
it counts the probability, item will be spoted by agent - probability is based on stress as well - about a time to get some idea how this work:)

Parameters:
newItem -
Returns:

seeingItem

public EItem seeingItem(AffordanceType affordance)
called from SearchEnvironment as well as from SearchRandom again a little bit of a dark magic, so look at it closely, study Klara's bachelor thesis

Parameters:
affordance - - affordance, which we are looking for
action - - action which will be satisfied by the item
Returns:

getItemOfAffordance

public ArrayList<EItem> getItemOfAffordance(AffordanceType aff)
used for instance in the increaseAttractivityToAllSources in perceptive field gets an item of provided AffordanceType

Returns:

isReady

public boolean isReady()
Returns:
the ready

setReady

public void setReady(boolean ready)
Parameters:
ready - the ready to set


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.