GithubHelp home page GithubHelp logo

gameinterop's Introduction

This is the common API that will allow to implement agents independently.

Important! You are allowed to make changes only in your group directories:

  • src/main/java/GroupX (here goes the main code of group X)
  • src/test/java/GroupX (here go the tests of group X)

The main interfaces of an intruder and guard are very simple:

/**
 * The interface of an intruder.
 *
 * You need to implement this interface in order to allow your agent play a role of an intruder.
 * This interface limits your actions to the actions allowed by intruders.
 */
public interface Intruder {

    /**
     * In order to decide an action the implementing agent receives percepts.
     *
     * @param percepts The precepts represent the world as perceived by that agent.
     * @return The action that the agent decides on taking.
     */
    IntruderAction getAction(IntruderPercepts percepts);

}
/**
 * The interface of a guard.
 *
 * You need to implement this interface in order to allow your agent play a role of a guard.
 * This interface limits your actions to the actions allowed by guards.
 */
public interface Guard {

    /**
     * In order to decide an action the implementing agent receives percepts.
     *
     * @param percepts The precepts represent the world as perceived by that agent.
     * @return The action that the agent decides on taking.
     */
    GuardAction getAction(GuardPercepts percepts);

}

This API makes heavy use of concepts of:

The value objects allow to create very clean interface for agent, but at the same time allow to precisely define what agents can perceive and do. Feel free to use the adaptor pattern to adjust the API to your liking inside your own code. Be warned that extending Interop classes is not allowed, and that they are made final intentionally in order to guarantee interoperability.

Please, inspect the packages:

  • Interop.Agent
  • Interop.Percepts
  • Interop.Action

I have also included very simple implementation of an automated tests.

The idea is very simple:

    public static void main(String[] args) {

        it("should do this (explanation of what you are testing)", () -> {
            boolean testCondition = true;
            assertTrue(testCondition, "explanation of your assertion");
        });
    
    }

You can see how that works in practice e.g. in src/test/java/Interop/Percept/PerceptsTest.java PerceptsTest#main.

gameinterop's People

Contributors

cambouvy avatar caviid avatar charleythefarmer avatar florenefeyzi avatar grimjjow avatar isinlor avatar jan-krueger avatar kata12 avatar krommn avatar lisosch avatar lsago avatar meelzak avatar merlinkoehler avatar pietro99 avatar seeeeeyo avatar stijnvdgroenendaal avatar vagab avatar vaishnavisirul avatar wisekik avatar

Watchers

 avatar

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.