Git Product home page Git Product logo

pydip's People

Contributors

otech-nl avatar taparkins avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pydip's Issues

Player.units or map?

Hey! First off, thanks for making this! I'm tinkering with an AI project revolving around Diplomacy and this library looks really useful.

I found the entry points you mentioned in the other issue, and got a basic turn loop working, but there's one thing I'm confused about. Player objects have lists of Unit objects, but the map also has a dict mapping country name strings to Unit objects, which seems like the same information being stored in two places. All the other functions seem to mostly operate on the map, and I'm unclear on how exactly to handle the Player.units lists - should I ignore them? If not, should I manually update them at the end of each turn, or is there a function to handle this that I missed?

Documentation or examples of basic usage?

Hey there! Nice looking library. I'm playing around with a little research project using Diplomacy, and I was wondering if you have any light documentation or examples of basic usage? If I can get a handle for what the main 'entrypoints' are here, I can bootstrap from there.

Just curious.

Self dislodgement tests fail

I'm using your wonderful library in a project of mine, but when I run the tests you've written, those related to self-dislodgement rules seem to fail. Specifically, the engine seems to allow self-dislodgement.

image

Wrong behavior (?) with a supported attack

Thanks for the well-designed package!

I did run into a strange situation that is somehow missed by the DATC suite (possibly because of the combination of using fleets and troops). I believe the resolution of the example below is incorrect as the troop attacking Bulgaria should be successful, despite its support getting attacked.

from pydip.player.unit import Unit, UnitTypes
from pydip.test.command_helper import CommandType, CommandHelper
from pydip.test.player_helper import PlayerHelper
from pydip.test.turn_helper import TurnHelper

helper = TurnHelper([
        PlayerHelper('Italy', [
            CommandHelper(CommandType.MOVE, UnitTypes.FLEET, 'Bulgaria South Coast', 'Greece Coast'),
        ]),
        PlayerHelper('Austria', [
            CommandHelper(CommandType.MOVE, UnitTypes.TROOP, 'Serbia', 'Bulgaria'),
            CommandHelper(CommandType.SUPPORT, UnitTypes.TROOP, 'Greece', 'Serbia', 'Bulgaria'),
        ])
    ])

result = helper.resolve()
assert result == {
    'Austria': {
        Unit(UnitTypes.TROOP, 'Serbia'): None,
        Unit(UnitTypes.TROOP, 'Greece'): None,
    },
    'Italy': {
        Unit(UnitTypes.FLEET, 'Bulgaria South Coast'): None,
    },
}

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.