Newcomb's problem

No preview image

1 collaborator

Rng_avatar Ronald Paul Ng (Author)

Tags

newcomb's paradoxv 

Tagged by Ronald Paul Ng over 3 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.0.4 • Viewed 87 times • Downloaded 13 times • Run 0 times
Download the 'Newcomb's problem' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

breed [ players player ]
breed [predictors predictor ]

players-own [
             choice
             score
             linked?
            ]
predictors-own [ %correct
                 linked?
                ]

to setup
  ca
  reset-ticks
  create-players 1000 [
                      setxy random-xcor random-ycor
                      set score 0
                      ifelse random 2 = 1 [ set choice "AB" ]
                                          [ set choice "B"]
                      set shape  "person"
                      set color white
                      set linked? false
                     ]
  create-predictors 1000 [
                      setxy random-xcor random-ycor
                      set shape  "person"
                      set color red
                      set linked? false
                      set-%correct  ;; set each predictor's chance of getting the prediction correct
                     ]
end 

to go
  ask players [
               link-up
               choice-prediction-discovery
              ]
  ;; after one round, reset all links
  ask links [die]
  ask turtles [set linked? false]
  tick
  if ticks >= 20 [stop]
end 

to link-up
  if (not linked?)
                 [create-link-with one-of other predictors with [linked? != true]
                  set linked? true
                  ask link-neighbors [ set linked? true ]
                 ]
end 

to choice-prediction-discovery ;; to find out the choice and the prediction
  let %predictive-power item 0 [%correct] of link-neighbors
  let player-choice [choice] of self   ; the variable player-choice is set to the choice of the turtle that calls this function
  ifelse random-float 1 <= %predictive-power [ let predicted-choice choice   ;; if predictive power is correct
                                               if predicted-choice = "AB" and choice = "AB" [ set score score + 1000 ]
                                               if predicted-choice = "AB" and choice = "B" [ set score score + 0 ]
                                               if predicted-choice = "B" and choice = "AB" [ set score score + max-amount-in-B + 1000 ]
                                               if predicted-choice = "B" and choice = "B" [ set score score + max-amount-in-B ]
                                             ]
  ;; if predictive  power is wrong, then the predicted-choice would be the opposite of the choice
  ;; such that if the choice is "AB", the predicted-choice would be "B", and if the choice is "B", the predicted-choice would be "AB"
                                             [ let predicted-choice choice   ;; the calculation of the score will be flipped
                                               if predicted-choice = "B" and choice = "AB" [ set score score + 1000 ]
                                               if predicted-choice = "B" and choice = "B" [ set score score + 0 ]
                                               if predicted-choice = "AB" and choice = "AB" [ set score score + max-amount-in-B + 1000 ]
                                               if predicted-choice = "AB" and choice = "B" [ set score score + max-amount-in-B ]
                                             ]
end 

to set-%correct
  if average-accuracy = 0 [set %correct 0]
  if average-accuracy = 0.25 [set %correct random-float 0.5]
  if average-accuracy = 0.5 [set %correct random-float 1]
  if average-accuracy = 0.6 [set %correct random-float 0.4 + 0.4]
  if average-accuracy = 0.75 [set %correct random-float 0.5 + 0.5]
  if average-accuracy = 0.9 [set %correct random-float 0.2 + 0.8]
  if average-accuracy = 1 [set %correct 1]
end 

There is only one version of this model, created over 3 years ago by Ronald Paul Ng.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.