Code Monkey home page Code Monkey logo

massim2019's Introduction

MASSim 2019

Current Development Iteration: Iteration 0.5

Contest Details and Simulator can be found at https://multiagentcontest.org/2019/. The following Gradle dependencies must be obtained and installed manually:

Progress

Iteration 0 Progress

Requirements:
  1. (DONE) Choose a task and parse requirements
  2. (DONE) Choose a requirement
  3. (DONE) Find block dispenser for requirement and align itself to the dispenser
  4. (DONE) Find Goal location and navigate to it
  5. (DONE) Submit Task
Issues & Further Comments:
  • We need multiple agents to create task patterns with more than one block.
  • Found issue with contest simulator and submitted GitHub issue & fix. (Resolved)
  • Code base is getting large, 80% of features still need to be implemented, bringing us to the following points:
    • There needs to be testing. Too many moving components are making it difficult to determine what's causing issues.
    • The code base needs to be refactored a bit more to make it more modular. Testing needs to be in place first to make sure nothing gets broken.

Iteration 0.5 Progress

  • Agent handles random (probablistic) action failures by repeating last attempted action (slippery vaccuum world)

Development Iterations

The following sections describe the various milestones for the Agent.

Iteration 0: MVP

This milestone represents the minimal deliverables required to make a functional agent. The Agent should be able to:

  1. Choose a task and parse requirements
  2. Choose a requirement
  3. Find block dispenser for requirement and align itself to the dispenser
  4. Find Goal location and navigate to it
  5. Submit Task

In this milestone, we make the following simplifications using the server config file provided by the simulation server:

  1. No obstacles (no need to perform complicated pathfinding)
  2. No Action failures
  3. Agent has unlimited visibility (no exploring/searching required)
  4. Only one Agent (no competing teams, no agent communication required)
  5. Agent ignores task deadlines
  6. Task requirements only require 1 block attached

Iteration 0.5: Better MVP

Building off of Iteration 0, we remove some of the simplifications. The Agent is required to perform with Action failures, additional agent teammates, task deadlines, and block patterns with 1 or 2 block requirements.

The agent is expected to perform under the following circumstances (requirements modified from Iteration 0 are in bold):

  1. No Obstacles
  2. Action Failures Occur (Make sure all action failures are handled accordingly)
  3. Agent has unlimited visibility.
  4. Two (or more) agents on the same team.
  5. Task deadlines are considered in task selection.
  6. Task requirements require 1-2 blocks.

Iteration 1: Pathfinding & Complex Block Pattern Agent

The agent behaviour should be able to perform in the competition on a very basic level. This iteration introduces obstacles and complex block patterns.

Building off of Iteration 0.5, we remove more of the simplifications. The agent is expected to perform under the following circumstances (requirements modified from Iteration 0.5 are in bold):

  1. Obstacles & Pathfinding (assume no attached blocks)
  2. Action Failures Occur (Make sure all action failures are handled accordingly)
  3. Agent has unlimited visibility.
  4. Two (or more) agents on the same team.
  5. Task deadlines are considered in task selection.
  6. Task requirements require 1 to many blocks.

Iteration 2: Limited Visibility Agent

This iteration reduces the visibility of the agent. This forces the agent to build a mental model of the map and to keep it updated. This mental model of the map should be shared across agents.

Note: Instead of the Agent handling the map model building, maybe this can be done by the environment. This might be too much responsibility for the agent. In this case, the environment would receive the percepts from the contest server and build the mental model, which would then be parsed and passed to the agent so that the agent can perform the higher level behaviour such as navigation, etc. Sharing the (parsed) mental model could be done by the agent.

The agent is expected to perform under the following circumstances (requirements modified from Iteration 1 are in bold):

  1. Obstacles & Pathfinding (assume no attached blocks)
  2. Action Failures Occur (Make sure all action failures are handled accordingly)
  3. Agent has limited visibility. (Build and share mental model of map)
  4. One team only.
  5. Task deadlines are considered in task selection.
  6. Task requirements require 1 to many blocks.

Iteration 3: Advanced Behaviour

At this stage, the agent will be mostly feature complete. We look to enhance the behaviour developed by the previous iterations. We look to introduce the following additions/modifications:

  1. Competing team.
  2. Advanced pathfinding (includes attached blocks)
  3. Advanced block gathering (agent can gather more than one block at a time on each side if it saves time, and can look for free blocks outside of the dispenser)
  4. Consideration for clear events.

Iteration 4: Temporal Agent

The goal of this iteration is to perform more advanced temporal reasoning about task deadlines. For example, can we estimate how long it will take to complete a task. There can be various strategies for this, including: chronicles and execution profiling. It is important to have a fully functioning agent before this stage and to establish a baseline for performance metrics. Any performance improvements (or performance hindrances) can be noted as a result of temporal reasoning.

massim2019's People

Contributors

mikevezina avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

agentcontest

massim2019's Issues

Better Navigation

Currently, we use Dijkstra shortest path for navigation. This works well for just the agent on its own.
As soon as we have multiple attachments that can be rotated and that block the agents navigation, Dijkstra does not work as well. Currently, if we can not navigate the dijkstra shortest path, we attempt rotations until our attachments do not block us anymore. This is not always feasible and we need a better solution.

Creating Complex Block Patterns

The agent must be able to strategize about how it creates the complex block patterns. When strategizing, we must take into account the following:

  1. Attached blocks can not move to cells with block dispensers. For example, if we have an attached block at relative position (0,1) and a block dispenser at (1,1), we can not move east. In contrast, the agent is free to reside on a cell with a block dispenser.

  2. We can only attach blocks to our self, we cannot attach a free block to a block that has already been attached to us. As of right now, I think this means we technically can't create patterns with a single agent if it requires more than one block.

Better Exploration

We can detect unexplored areas of the map, even without knowing map boundaries, but using the knowledge that the map is rectangular. We can estimate bounds based on obstacle walls we have seen. Even if this estimate is incorrect, it at least pushes the agent into unexplored territory.

Block Requirement Planner

Currently, we use transitions between blocks to plan the sequence of requirements. For example, we iterate through all requirements and build a sequence based of whether or not the next block is immediately west, east, or south of the previous requirement.

Another alternative would be a different planning algorithm (I'm thinking GraphPLAN).

The only issue with using GraphPLAN is that it introduces overhead and is potentially too expressive for what we need.

Will look into this further.

Edge Case Handling / Testing

As the code base grows, it's becoming increasingly difficult to trace which components are causing issues. There needs to be some investment of time and effort into Jason testing for plans and rules.

Authenticating (Identifying) Other Agents

One of the main challenges with the simulation is that the perceptions of other teammates does not tell us which other teammate it is. For example, let's say we have three agents {A1, A2, A3} at locations (0,0), (0,1), and (0, 2) respectively.

Agent A1's perceptions for entities are as shown (for A2 and A3):
thing(0, 1, entity, "A") (only tells us the team of the entity, but we have no idea this is A2)
thing(0, 2, entity, "A")

A2's Percepts (the first is A1, the second is A3)
thing(0, -1, entity, "A")
thing(0, 1, entity, "A")

A2's Percepts (the first is A1, the second is A2)
thing(0, -2, entity, "A")
thing(0, -1, entity, "A")

Solution 1. There is one trivial solution, which is to ask all teammates if they have a thing perception with negative coordinates. i.e:
A1 asks team if anyone has thing(0, -2) (A3 will answer)
A2 asks team if anyone has thing(0, -1) (A3 answers, A2 and A3 can conclude that they see each other)

This doesn't work well if we have more than one pair of agents with the same relative X, Y components (in this case, all pairs of agents will register each other as the perception even if they are not in the range of perception). This is easily demonstrated with a team of 4 or more agents.

Solution 2. The second proposed solution would be to take a "signature" of perceptions that are seen by each perceived agent. For example, if Agent 1 and 2 perceive each other, they calculate a signature of all terrain and things within their shared perception range. They can use this signature to verify each other.

We must use the following assumptions:

  1. Two agents can not occupy the same space (satisfied by simulation limitations)
  2. There must be at least 2 terrain spaces or things used within the signature.

If Assumption 2 doesn't hold, it is still likely that we encounter the same issue as proposed solution 1. For example, consider two pairs of agents outside of each others perceptions and that both pairs shared perception range consist of only empty spaces or one terrain block placed in the same relative location. This would result in generating the same signature. We want to have a minimum of two terrain or entities to decrease signatures clashing.

Solution 3: During the first few steps of the simulation, we can establish authentication between two agents by associating a unique block to each agent.

For example, let's say the server utilizes two types of blocks: {b0, b1} but have 4 (or less/more) agents that we need to authenticate. Since there are two unique blocks (b0 and b1), we can tell each agent to attach to the block. I.e. tell agent A1 to attach to block b0 and A2 to attach to b1.

Any teammates that perceive these agents can authenticate A1 and A2 based on the blocks that will also be perceived. Once these two agents have been authenticated by the rest of the team, we then assign the blocks to the next two agents. This is more time consuming than the previous methods and could potentially be a waste of simulation steps (if the agents spend too much time looking for blocks to attach or waiting for all team agents to authenticate).

Once we have authentication:
Once a pair of agents are authenticated, they can permanently keep track of each others positions even while they escape immediate perception. This allows us to communicate dispenser locations, etc. between agents. The main point of authentication is to properly identify each teammate so that the locations can be shared between each agent.

Another thing to note: once one (or more) pairs of agents are authenticated with each other, we can communicate this to any agents that are authenticated in the future.
An example:
A1 authenticates A2.
A2 leaves perception of 1.
A1 authenticates A3.
A1 can extend A2's authentication to A3, so that A2 and A3 can authenticate each other without being in each others perception. This is done by sharing A2's absolute position once A3 is authenticated.

Final Note: Once we have authentication between two or more agents, it becomes possible to coordinate movements, provide navigation between agents, communicate object positions, etc. This allows us to perform some of the higher-level functionalities, but without proper agent authentication, each agent is basically limited to it's own mental notes and perceptions (which won't get them very far).

Extract Task Selection

One way of selecting the best task can be done by utilizing internal actions. This way we don't have to filter tasks and requirements in AgentSpeak.

Better Attachment Detection

The attach perceptions provided by the simulation are not reliable (we can perceive other nearby agent attachments, and we might interpret these as our own attachments).

If we pay attention to which blocks we explicitly attach and detach, and share this knowledge with other agents, this might improve this.

Note that when agents connect two blocks, they get dragged around with each other. We need to detach an agent before we start moving.

Remaining Work

Should probably create a separate issue for each of these, but I just needed to do a quick mind dump. Here are a few edge cases I still need to consider, and some additional notes:

  1. Being spawned/placed in a box (no exits)
  • Need to use clear action, or wait for a clear event to occur (although the former should be done, and not the latter).
  1. Being disabled (by a clear event, or other agent)

  2. Evade clear events within the radius of an agent (unless it is that agent's clear event)

  3. Better path navigation. I think the best way to do this is have some kind of localized steering/navigation that is done within Jason, and use a long-term (or bigger scale) navigation system implemented in Java (A*, etc.).

  4. Larger patterns, if an agent is the one receiving the block (aka the one holding the pattern), they should be the one responsible for making sure the next block location isn't blocked.

  5. Better task selection. Look at which dispensers are closest,

  6. If enemy agent is blocking location (aka dispenser), maybe "poke" them with a clear action so that they can move for us ;)

  7. Better exploration. I was thinking maybe trying to detect map borders using detected obstacles.

Dealing with Attached Perceptions

The agents can see all attached blocks in its perception (even if the block is attached to another agent). This means that we can't rely on the "attached" perception to tell us which blocks are/aren't ours.

I.e. if we have two blocks attached at (0,1) and (1,1), and agent A3 located at (3,1) has one block attached at (2,1), the attached perceptions are:
attached(0,1)
attached(1,1)
attached(2,1).

We need to keep track of which blocks are attached upon success of the attach or connect command.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.