Giter Site home page Giter Site logo

Comments (8)

Niels-van-den-Hork avatar Niels-van-den-Hork commented on September 21, 2024

Its a numpy array, you can use

def strategy(history, memory):
	round_nr = history.shape[1]
	my_hist = list(history[0])
	opp_hist = list(history[1])

to transform it to lists

from prisonersdilemmatournament.

peterHoburg avatar peterHoburg commented on September 21, 2024

History is a 2d NP array. So

a = [
    [1,0,1,0...],
    [0,0,0,0...]
]

You can access it just like a normal python list

a[0][0] == 1

from prisonersdilemmatournament.

AggamR avatar AggamR commented on September 21, 2024

History is a 2d NP array. So

a = [
    [1,0,1,0...],
    [0,0,0,0...]
]

You can access it just like a normal python list

a[0][0] == 1

oh so a[0] is my actions and a[1] is the opponent's actions? or vise versa? or not that at all?
also, do I need to turn it into a python list first, like @peterHoburg mentioned? or can I just do that on the array?

from prisonersdilemmatournament.

WalterCM avatar WalterCM commented on September 21, 2024

History is a 2d NP array. So

a = [
    [1,0,1,0...],
    [0,0,0,0...]
]

You can access it just like a normal python list

a[0][0] == 1

oh so a[0] is my actions and a[1] is the opponent's actions? or vise versa? or not that at all?
also, do I need to turn it into a python list first, like @peterHoburg mentioned? or can I just do that on the array?

I guess you can do whatever you want. @peterHoburg was just giving you a suggestion if you didn't want to work with np arrays.

from prisonersdilemmatournament.

AggamR avatar AggamR commented on September 21, 2024

History is a 2d NP array. So

a = [
    [1,0,1,0...],
    [0,0,0,0...]
]

You can access it just like a normal python list

a[0][0] == 1

oh so a[0] is my actions and a[1] is the opponent's actions? or vise versa? or not that at all?
also, do I need to turn it into a python list first, like @peterHoburg mentioned? or can I just do that on the array?

I guess you can do whatever you want. @peterHoburg was just giving you a suggestion if you didn't want to work with np arrays.

oh ok, but I still have a question:

so a[0] is my actions and a[1] is the opponent's actions? or vise versa? or not that at all?

from prisonersdilemmatournament.

peterHoburg avatar peterHoburg commented on September 21, 2024

History is a 2d NP array. So

a = [
    [1,0,1,0...],
    [0,0,0,0...]
]

You can access it just like a normal python list

a[0][0] == 1

oh so a[0] is my actions and a[1] is the opponent's actions? or vise versa? or not that at all?
also, do I need to turn it into a python list first, like @peterHoburg mentioned? or can I just do that on the array?

I guess you can do whatever you want. @peterHoburg was just giving you a suggestion if you didn't want to work with np arrays.

oh ok, but I still have a question:

so a[0] is my actions and a[1] is the opponent's actions? or vise versa? or not that at all?

a[0] are your actions.

from prisonersdilemmatournament.

Bip901 avatar Bip901 commented on September 21, 2024

Possible duplicate of #22

from prisonersdilemmatournament.

carykh avatar carykh commented on September 21, 2024

@Niels-van-den-Hork and @peterHoburg are correct! It's a 2D numpy array where the first axis is which player it is (0th row is your history, 1st row is your opponent's history) and the second axis is what turn it is

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.