Questions tagged [simulation]

Simulation is the imitation of some real thing, state of affairs, or process. The act of simulating something generally entails representing certain key characteristics or behaviours of a selected physical or abstract system.

Filter by
Sorted by
Tagged with
6 votes
1 answer
236 views

Statistical simulation

I've written the following program as a submission to the German Federal Computer Science Competition for highschool students. The program makes the following simulation with a given number of days ...
FUZxxl's user avatar
  • 641
4 votes
0 answers
621 views

Speed up a monte carlo simulation with nested loop

I would like to know if there is a more efficiency way to speed up below code. It uses a procedure where subsampling is required in the nested loop (which a previous answer helped to make more ...
barryq's user avatar
  • 141
6 votes
1 answer
205 views

Randomizing and mutating algo class - functionality

See Randomizing and mutating algo class - style I'm looking for a review of the functionality of this code, answers to the above question which also describes the code use focus on style instead. ...
alan2here's user avatar
  • 289
5 votes
2 answers
317 views

Randomizing and mutating algo class - style

I've updated this question to be about code style only, as all of it's answered focused on this aspect. For the codes function, see Randomizing and mutating algo class - functionality ...
alan2here's user avatar
  • 289
5 votes
4 answers
9k views

Monte Carlo coin flip simulation

I've been learning about Monte Carlo simulations on MIT's intro to programming class, and I'm trying to implement one that calculates the probability of flipping a coin heads side up 4 times in a row ...
user avatar
6 votes
1 answer
6k views

RPG Dice Roller

This is sort of a follow up to my post yesterday. I'm a relative newbie to Python and before I made a d20 dice roller for RPGs. Now I've made a dice roller for any type of dice, and I would love ...
lerugray's user avatar
  • 605
11 votes
2 answers
3k views

Random D20 number generator

I'm teaching myself code using Zed Shaw's Learn Python The Hard Way, and I got bored during one of the memorization lessons so I thought I would make a random D20 number generator for when I play RPGS....
lerugray's user avatar
  • 605
8 votes
3 answers
2k views

Imitate randomness of a dice roll

I have written some code in Java that consists of two classes. I have tried my best and I want you to tell me if I can improve and how good this is. Also, how important is OOP? Java is an object ...
Aayush's user avatar
  • 81
1 vote
2 answers
228 views

Die-rolling for ordering

I have a little experience with Python and am trying to become more familiar with it. As an exercise, I've tried coding a program where the ordering of a list of players is determined by the roll of a ...
jlim's user avatar
  • 103
3 votes
1 answer
3k views

Baseball game state class in python looking for feedback

So far, this is just a class that tracks the state of a baseball game. Unfortunately, I can't tell you for sure what the next step is. It might be a an interactive playable baseball game, or a game ...
jgritty's user avatar
  • 177
5 votes
2 answers
930 views

Human (imperfect) array (card) shuffle written in C

I've got this humanoid_shuffle I wrote in Python. I've been wanting to learn C so as an exercise I ported it to C. As this is my first venture into C and even the ...
jondavidjohn's user avatar
2 votes
1 answer
76 views

Is there a more efficient way to simulate in R, by exposition factor, gender and disease profile?

I started working with R recently and need to do a simulation for 100 000 people that divides them in exposition factor for a disease, gender and presence or absence of disease. My background info is ...
Beatriz's user avatar
  • 21
3 votes
1 answer
2k views

Memory leaks in lottery simulator

I'm primarily a C++/Java programmer, but I've recently started using Python at work and decided to write a Lottery Simulator at home. I wrote it to test out different combinations of lottery numbers ...
Chris Just's user avatar
5 votes
2 answers
1k views

Discrete event simulation with variable intervals

I've built a discrete event simulation system, similar to the bank problem presented on the wikipedia page but with a key difference. Let's say, that a TELLER can ...
GaretJax's user avatar
  • 151

1
4 5 6 7
8