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.
6
votes
1answer
182 views
HTML / JS Slot Machine Simulator
This code is a slot machine simulator that uses elements of both HTML and JavaScript. Please pardon the lack of comments.
...
3
votes
2answers
89 views
Implement operation and simulation mode in an interface
Context:
I have to create an interface between devices and a client.
My package is composed of:
Device.py
Error.py
DeviceA.py (for example)
DeviceB.py
...
Basically each ...
5
votes
2answers
74 views
Change random list of numbers into all 5's using simple evolution simulation
This is supposed to be an evolutionary algorithmic program, and I'm not sure if it does what it's supposed to do.
It is supposed to take a random list of numbers (containing at least one 5), and over ...
4
votes
2answers
135 views
Worker AI and Job Queue Management for Simulation Game
So I've been working on AI for a Tower Building simulation game for quite a few days, and I think the code would really benefit from review. I'm a hobbyist programmer, but I really care about doing ...
5
votes
1answer
43 views
Simulating Pendulum Motion in Android
Quite sometime back I had written an Android application which simulates the path of a pendulum. You can also have look at the complete discussion in my technical blog here.
Please review it and ...
5
votes
1answer
105 views
Managing People in a SimCity Clone
So I am working through a few different game ideas as I learn programming, and I could definitely use some feedback on my latest project. This is a simple SimCity clone. So far I have created a City ...
3
votes
1answer
65 views
Single Rotate Method
I just started coding a simulation-like application. It's about our solar system. Right now, I'm working on rotating the moon. I have this constructor
...
1
vote
2answers
97 views
Adding very large arrays
I am writing a stochastic simulation for a Yule process:
If you start with a certain number of bins each containing a random number of balls, you add another ball to an existing bin with a ...
9
votes
2answers
448 views
Dice-rolling simulator
I know there is a better way to store data. What is the most concise way to simplify this script?
...
1
vote
0answers
123 views
Pick up and throw simulation in SpriteKit [closed]
Last days, I experimented some time with spriteKit and (amongst other things) tried to solve the problem to "throw" a sprite by touching it and dragging.
I have tackled the major hurdles, and the ...
8
votes
1answer
82 views
Switch-case Monstrosity for CPU Emulator
I am still working on A Z80 CPU emulator and I have decided to prototype it in javascript and then translate it into a faster language, It might be ported to C but more likely is Java - this means I ...
10
votes
3answers
297 views
Enigma simulator performance
Here is my implementation of a simple 3 rotor Enigma machine in C++:
...
12
votes
3answers
183 views
Suggestions needed after modification of Simulation of an Ocean
After suggestions given in this question, modifications to the code has been done.
Only thing I could not do is to decide, where to place the starveTime property ...
9
votes
3answers
920 views
Simulation of an ocean containing sharks and fish
As part of my Java learning, I tried solving part I of problem description here. The only issue that I see now is that I could not close the button of Frame.
Please review and provide your comments ...
3
votes
0answers
71 views
Equation evolution [closed]
I'm coding something to simulate evolution, but with an equation that is tested to find the digitsum of an algorithm. Basically what it does is that it creates ...
7
votes
1answer
112 views
Model simulation using Java annotations
A couple of days ago I posted my code that models systems made up of moving parts. I got several great tips and ideas and here is my latest version. My actions are now methods annotated with @Action ...
14
votes
5answers
3k views
7
votes
2answers
107 views
Improvements/suggestions for my CPU emulator
I am trying to emulate a basic CPU (Z80) as close as possible. It currently does not read real assembly code, but that will be implemented. If you have any views on how that could be implemented, ...
3
votes
2answers
120 views
How can I make my ant simulation faster?
I was not sure if I should post about 200 lines here. I want to make this ant simulation faster. The bottleneck is at Ant.checkdistancebetweenantsandfood().
It ...
1
vote
1answer
202 views
Correct logic in Monty Hall Problem? [closed]
I've written this code in an attempt to create the Monty Hall problem and check the ratios. I would like someone to check the logic on it. I know it isn't organized well at all; I just need to see if ...
2
votes
1answer
503 views
Multithreaded horse race simulation
I'm just starting to get along with threads in Java and I need some code review,
about interfaces, classes, managing threads, correct writing, secure threads, exposed objects etc.
Horse-Race ...
2
votes
1answer
258 views
Is this an elegant/accurate simulation of the Monty Hall problem?
I'm trying to simulate the Monty Hall problem, to statistically determine if there is any benefit to changing my choice after a door containing a goat is open (testing this guy's Monty Hall theory on ...
2
votes
2answers
84 views
Bouncing-ball simulation
I posted a couple questions about a week ago, but have almost gotten it working. This program is supposed to simulate the following:
Ask the user how many balls to drop
Drop one ball at a time
...
1
vote
4answers
288 views
Improving Lottery Simulation
I'm working on a project for an Intro to C/Python class and am looking to improve the efficiency of the program. The program is a lottery simulation where the user inputs the number of tickets they ...
5
votes
1answer
140 views
Simple taxi emulator
This app is a simple taxi emulator. The only feedback I've got on it was "bad internal architecture", that's why I would be grateful to receive more adequate and humiliating review.
Simply-speaking, ...
1
vote
0answers
267 views
Python Code Review, Inventory Simulation using Pandas Dataframe
I've been learning python like for a year and started learning a little about pandas DataFrame. I made this little program to practice all the concepts and would like to hear your suggestions for ...
8
votes
1answer
387 views
Haskell Particle Simulation
I recently started learning Haskell and as my first project I decided to port a particle simulation I had written in C.
The simulation is pretty simple. We have a cubic box with particles (spheres) ...
6
votes
1answer
137 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 ...
4
votes
0answers
193 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 ...
3
votes
0answers
136 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.
...
6
votes
2answers
237 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 Review: C++ Algo - Function
...
6
votes
3answers
391 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 ...
1
vote
2answers
176 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 ...
3
votes
1answer
486 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 ...
1
vote
1answer
54 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 ...
4
votes
2answers
407 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 ...