Giter Site home page Giter Site logo

Comments (3)

nobody5050 avatar nobody5050 commented on September 22, 2024

I’d presume that if you have a valid reason to go over 10ms it shouldn’t be that big of an issue. Spending something like 10s however is a sign that you’re doing something wrong/inefficient

from prisonersdilemmatournament.

duckboycool avatar duckboycool commented on September 22, 2024

I’d presume that if you have a valid reason to go over 10ms it shouldn’t be that big of an issue. Spending something like 10s however is a sign that you’re doing something wrong/inefficient

I would say that you should definitely try to stay under 10ms per turn (which will be at least 2 seconds just on your strategy for one round). As it is, running the final pool will probably take days even with multiprocessing. If your strategy is slower than 10ms, you're really going to be slowing that down and could risk being removed due to taking too long.

Also, you should generally use time.perf_counter for something like this instead of time.time. It might have a finer resolution and won't be affected if your system clock changes (although that's unlikely in this case).

from prisonersdilemmatournament.

zebarnabe avatar zebarnabe commented on September 22, 2024

There are several ways agents might want to use as much time as possible to improve their performance (training neural networks/other machine learning, Monte Carlo tree search, ...). I read that a reasonable goal is to finish your turn in 10 ms.

When you state to finish your turn in 10ms I assume it per call of the strategy method. 10ms is a lot of time, unless you are running the tournament in a raspberry pi, the time it takes might depend a lot on the hardware where it is running. With that in mind this could create a hardware dependency on the performance of such strategy...

I consider my agent implementation to be on the heavy side and it takes 0.13ms per turn (it was taking twice that before optimizing the code) when running it in a modern CPU against a bunch of different strategies. I even scrapped the idea of doing some sort of probabilistic inference to find out what would be the most profitable probable play to do due to concerns for the performance of the whole tournament.

The only way I see for it taking more than 10ms per turn would be with some sort of online learning agent, but I don't think 200 trades is enough for it to profit from it, specially since the learning would be lost after the paired match ended. The rules don't forbid such behavior (as it doesn't count as "being intentionally inefficient with loops or sleep() commands"), but it is sure a concern when comes to it.

I would say that people should use common sense when designing their agent.

For reference, in my machine, the implementation of the some strategies take the following time per turn (per call of strategy):

  • AlwaysCooperate/AlwaysDefect take around 0.75μs
  • grimTrigger takes around 1.00μs
  • most of the TitForTat and similars take around 1.20μs
  • random takes around 1.40μs
  • short but complex strategy implementations, like advanced detectives or windowed scans take something between 10 to 20μs
  • my own agent - that I consider it to be quite heavy - takes around 130μs, while my colleagues made ones take around 35μs

(μs = microseconds or 0.001ms or 10^-6 seconds)

For me 10ms looks like an eternity...

from prisonersdilemmatournament.

Related Issues (20)

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.