Group Abstract Group Abstract

Message Boards Message Boards

0
|
7K Views
|
12 Replies
|
2 Total Likes
View groups...
Share
Share this post:

RandomChoice[] and RandomInteger[] issues

Valeriu, thank you for checking it up on Windows. I experimented with the code a bit more and it seems that on Mac OS X adding this

ListPlot[Sort@Tally[population], Filling -> Axis, 
PlotRange -> {{0, 1}, {0, numberOfPlayers}}, PlotTheme -> "Detailed"]

is fine but adding this

Dynamic[ListPlot[Sort@Tally[population], Filling -> Axis, 
  PlotRange -> {{0, 1}, {0, numberOfPlayers}}, 
  PlotTheme -> "Detailed"]]

repeatedly breaks the code. Could you run the code on Windows with the above bit included?

POSTED BY: Michal Ramsza
12 Replies

Are you planning to write a separate post explaining your notebook and research?

POSTED BY: Sam Carrettie

You are welcome!

I have now official confirmation from Wolfram support that there is some problem with the interplay of RandomInteger[] and dynamic features. The code seems to work fine on Development Cloud. Also, I checked the results with published papers and other approximations done through differential equations. All results are consistent so the problem is not with core Mathematica but additional things like Dynamic[]. Thank you for the help. If I have any information I will share it.

POSTED BY: Michal Ramsza

Thank you for the help. I will put the whole post later today.

POSTED BY: Michal Ramsza

It would be actually interesting to see a full post about explaining everything step by step. Not in the notebook but in the body of the post. Maybe more people will get interested.

POSTED BY: Sam Carrettie

Agree!

This will work since number of players is always 10 times the number of pure strategies (but the simulation doesn't make sense). So in a way, this code samples only part of population but several times (random).

POSTED BY: Michal Ramsza

Michal, I have found some errors in the code. It has inconsistency. Nevertheless, I have highlighted my findings. They are in the attached nb file. It seems that the piece of code related to the generation of payoffs must be verified.

Attachments:

I have done a modification

randomOpponents = 
  RandomInteger[{1, numberOfStrategies}, numberOfPlayers];

and the code works even it still generates errors. It seems that the algorithm must be revised.

I have done some experiments up to t <= 35 000. Nice code. But there is somewhere an error in the code and it must be found.

Valeriu, I attach the notebook. Thank you for help.

Attachments:
POSTED BY: Michal Ramsza

Michal, Unfortunately I can't run the code because the moderation team deleted the content of this discussion. I didn't save the code on my computer.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard