Presentation is loading. Please wait.

Presentation is loading. Please wait.

Rescuecore A Java development kit for Robocup Rescue.

Similar presentations


Presentation on theme: "Rescuecore A Java development kit for Robocup Rescue."— Presentation transcript:

1 Rescuecore A Java development kit for Robocup Rescue

2 Why? Represent our view of the world Talk to kernel Provide debugging Testing tools

3 Architecture

4 The World Rescue simulation defines several object types –Road –Node –Building –Civilian –Fire Brigade –...

5 The World (continued) We want to have the same types available for our agents Each object in the simulation is wrapped in a Java class Objects have get/set methods for fields

6 Class Heirarchy

7 Memory The Memory object holds all our information about the world Can look up objects by ID or type Can find common properties of objects –Position –Distance between two objects

8 RescueObject Base class for all objects in rescue environment Data is stored as name-value pairs (sort of) –Actually a map from property id to value Subclasses provide access to data in a nice way

9 Example: Road Has get methods for all data –getWidth() –getBlock() –getLength() –... Set method for altering blockedness –boolean setBlock(int block, int timestamp)

10 Talking to the kernel Communication protocol is fairly complex and poorly documented Rescuecore hides all the details Agents talk to the kernel with Commands –AK_EXTINGUISH –AK_MOVE –...

11 Agents A base Agent class is provided Provides mechanisms for: –sending commands –receiving hear/sense messages –automatic updates of Memory from kernel Subclasses only need to implement a couple of methods

12 The AgentSystem Launches Agents and connects them to the kernel Passes messages from the kernel to the target Agent Does the actual sending of Commands

13 A Simple Agent Only need to implement two methods –void sense() –boolean hear(int from, byte[] message) Can implement initialise if needed –void initialise(AgentSystem, int id, RescueObject[] knowledge, RescueObject self)

14 A Simple Agent (continued) protected boolean hear(int from, byte[] data) { return false; } protected void sense() { Building target = findCloseFieryBuilding(); appendCommand(Command.AK_EXTING UISH(id,target.getID()); }

15 Using the Memory private Building findCloseFieryBuilding() { RescueObject[] all = memory.getObjectsOfType(TYPE_BUILDING) for (int i=0;i<all.length;++i) { if (((Building)all[i]).isOnFire() && memory.getDistance(me(),all[i]) < MAX_EXTINGUISH_DISTANCE) return all[i]; } return null; }

16 Memory Functions RescueObject[] getAllObjects() RescueObject[] getObjectsOfType(int type) RescueObject lookup(int id) int[] getXY(RescueObject o) double getDistance(RescueObject o1, RescueObject o2)

17 Agent Functions RescueObject me() void appendCommand(Command c) void flushCommands() void say(byte[] message) void tell(byte[] message)

18 PlatoonAgent Functions void move(int[] ids) void clear(Road target) void extinguish(Building target) void load(Humanoid target) void unload() RescueObject getLocation() int getPosition()

19 MemoryListeners Event mechanism for memory model void objectAdded(RescueObject o, int time) void objectChanged(RescueObject o, int property, int time) Memory class has methods for adding/removing MemoryListeners

20 PropertyListeners Can also listen for individual property changes on an object void propertyChanged(RescueObject o, int property, int time) RescueObject has methods for adding/removing PropertyListeners

21 Debugging Not well implemented yet Agent class has a logging method –void log(String message) –Writes to a file called agent.log More functionality will be added later

22 Tools RandomConfig –Generates random placements of agents and fires MapGenerator –Generates random maps Quake –Generates earthquake data –Not written yet – any volunteers?

23 Writing Clever Agents Suppose we want to use fuzzy logic for deciding which roads to take Implement a Memory called FuzzyMemory Whenever a Road gets added to the FuzzyMemory it replaces the Road with a FuzzyRoad If an agent calls lookup() then it gets returned a FuzzyRoad

24 Project Ideas Prediction of fire spread Better path planning algorithms –Need to cope with uncertainty about roads Teamwork Centralised vs distributed control Searching for buried civilians/new fires Communication


Download ppt "Rescuecore A Java development kit for Robocup Rescue."

Similar presentations


Ads by Google