Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

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
0 votes
0 answers
48 views

I am creating a program to create digital twins of enterprises. I am using the Simpy framework for this purpose. I'm creating a universal system that can model almost any enterprise, but I have a ...
Андрей Александров's user avatar
6 votes
3 answers
969 views

How do I optimise my code more? The goal is to have my code work with more than 200 moving balls, but that takes forever right now and doesn't look smooth at all. Furthermore, I can't get the sizing ...
Theron_Isengard's user avatar
0 votes
0 answers
49 views

I have this R code for mediation analysis based on AFT. Can someone take a look? https://github.com/cristianricciwork-commits/aft-mediation..git I suggest to take a look at the .pptx (there are ...
Cristian ricci's user avatar
1 vote
2 answers
167 views

Intro This time, I was in the mood for concurrent programing (ProducerConsumerSimulation.java). To this end, I have ended up with the code below. My primary concerns are: Class design is trash, The ...
coderodde's user avatar
  • 32.2k
12 votes
4 answers
1k views

I've been giving my grade tens an introduction to computational phylogenomics, based around computing dissimilarity between DNA strands, and a simplified model of mutation. They've been exploring how ...
AkselA's user avatar
  • 223
7 votes
2 answers
854 views

I have made up some evolutionary rules for a type of cellular automaton that uses numbers instead of the more common binary black or white cells. Rules in English: Takes place on a square grid that ...
R1s1ble's user avatar
  • 171
5 votes
2 answers
556 views

Research paper: The Random Skipping Sequential (RSS) Monte Carlo algorithm The main algorithm described in the given link is a Random Skipping Sequential Monte Carlo Algorithm (RSS Algorithm) ...
user366312's user avatar
6 votes
1 answer
266 views

I've implemented the Simulated Bifurcation (SB) algorithm in C++, based on the method described in [2] (link to Science Advances). The goal of this algorithm is to find the ground state of an Ising ...
Amirhossein Rezaei's user avatar
2 votes
1 answer
194 views

Yatzy Yatzy is a dice rolling game where players aim to get particular die combinations. This program counts probability of each such combinations. They are: All five ones, All five twos, Same for ...
coderodde's user avatar
  • 32.2k
8 votes
2 answers
365 views

My program calculates the symbol error rate for various signal-to-noise ratio (SNR) and modulation orders using Monte Carlo simulation on Phase Shift Keying (PSK). How can it be improved? ...
unique's user avatar
  • 235
1 vote
1 answer
188 views

This time, I have prepared this page where a user may select what AI bots will be run in the game of Connect Four. The entire repository is here. Code index.html: <...
coderodde's user avatar
  • 32.2k
3 votes
5 answers
2k views

This is a program to solve a differential equation numerically using Euler method. As of now, it is very slow, and I need to run 10000 Monte Carlo simulations. The differential equation is called ...
Jonathan Wick's user avatar
3 votes
1 answer
97 views

I have a list of car models which I want to simulate by launching multiple instances of an external simulator executable. My application stores the current status of all the cars that are being ...
Harry's user avatar
  • 429
4 votes
1 answer
212 views

Years ago, I wrote some code in Perl for the Chutes and Ladders game. I re-wrote the code here in Python. The code simulates one player in a game to see how many spins of the dial are needed to win ...
toolic's user avatar
  • 16.1k
2 votes
3 answers
228 views

A friend posed to me a question to see if I could solve it. He says I solved it appropriately. I was hoping someone here could give me a review of the program I wrote to answer it. I figured it would ...
Dan's user avatar
  • 301
3 votes
1 answer
88 views

I was studying stochastic processes and thought to independently simulate a moving average process. ...
insipidintegrator's user avatar
4 votes
2 answers
532 views

I am working on a Boid simulation with 10,000 boids. I've successfully utilized geometry shaders and an array<GLfloat[3], MAX_BOIDS> for vertices to enhance ...
nowox's user avatar
  • 1,121
2 votes
1 answer
112 views

I'm trying to implement the dynamics of Dengue transmission between mosquitoes and humans. I decided create two classes, one for the human population and another for the mosquitoes. Both are based on ...
Athansya's user avatar
0 votes
1 answer
101 views

Are the formulas used in getTemperature() and setTemperature() correct? ...
user366312's user avatar
1 vote
2 answers
225 views

Please review this C++ listing of an implementation of Leapfrog integration. This C++ listing is rewritten according to this review. ...
user366312's user avatar
1 vote
1 answer
94 views

I have written a function in c++, which accepts an "ifstream" object (file) to read from and a string to match a header token in the file. This way I am counting how many times a token ...
Syed Shuja Zaidi P19PH007's user avatar
1 vote
1 answer
87 views

The Problem As part of my doomed efforts to learn Rust, I decided to get to grips with how the language handles classes and objects. But, instead of taking on some well-known exercise, I thought it ...
Tom Hosker's user avatar
1 vote
1 answer
88 views

The following is a Rust implementation of polymer simulation where the PBC(periodic boundary condition) has been implemented using the Ewald Summation technique. Can you review the code? Is the PBC ...
user366312's user avatar
6 votes
2 answers
904 views

Can you review the following code to check to see if the Minimum Image Convention is properly implemented? ...
user366312's user avatar
0 votes
1 answer
278 views

I have recently become interested in simulating logic circuits because of a electronics class at school. I have created a functioning simulator for logic gate circuits in Python. My implementation ...
turt1edman's user avatar
6 votes
2 answers
555 views

I have written a code to calculate the MSD of some molecules. The code averages over multiple time origins (sliding time window) and over all the molecules. I have also made it do one extra thing: do ...
mjksho's user avatar
  • 61
2 votes
1 answer
219 views

The goal is to simulate a real flat plate capacitor in 2D. The potential of the armature is fixed to +V and -V, on the edges of the simulation cell the potential is zero. Between the plates of the ...
Pietro Scapolo's user avatar
3 votes
1 answer
119 views

So I'm simultaneously learning both Rust and Smoothed Particle Hydrodynamics. I've been using this video from AMD as a reference and the provided smoothing kernels. At this stage, I've not optimised ...
ScottishTapWater's user avatar
1 vote
1 answer
229 views

(See the previous iteration.) This time, I removed the stuff I don't need in my demo runner. Also, I consolidated some code that seemed DRY to me. Simulation rules When a female arrives, she ensures ...
coderodde's user avatar
  • 32.2k
3 votes
2 answers
167 views

(See also the next iteration.) I have this small simulation program simulating a toilet seat. The toilet seat may be in two positions: up or down. If a male arrives to the toilet to urinate, and ...
coderodde's user avatar
  • 32.2k
3 votes
1 answer
91 views

I've been self-studying HTML/CSS/JS. I read about Wa-tor. It's a population dynamics simulation which simulates fish and sharks breeding and predating. This seemed cool so I decided to implement it....
Jeff's user avatar
  • 33
4 votes
2 answers
1k views

To avoid a code dump I have removed most of the code and left the first few lines of constructors and methods and anything relevant. Full code at the bottom. The purpose of this code is to use threads ...
Corey Hodges's user avatar
11 votes
3 answers
567 views

I am a junior Software Engineer, C++ is usually my main jam but I started picking up Python for a research project I am doing in college. I am eager to learn as much Python syntax, tricks, best ...
hexaquark's user avatar
  • 213
2 votes
1 answer
405 views

I am making a module that allows you to create sand and simulate it. I have successfully done this, but it runs very slowly. I need this to be able to simulate at least 1000 particles, at a fps higher ...
susthebus's user avatar
2 votes
1 answer
163 views

I have created the following code: Option Explicit ...
user avatar
2 votes
1 answer
96 views

What my program does I'm trying to estimate for how many minutes in average a football(soccer) match will be in different game states depending on implied goals of both teams. Problem domain For our ...
Konstantin Kostanzhoglo's user avatar
7 votes
2 answers
661 views

I've got this code: ...
Nils Edström's user avatar
5 votes
2 answers
171 views

https://youtu.be/XEt09iK8IXs?t=1264 Ben Awad did a mock interview with a React developer and asked this question: There are a set of 100 holes (0-99). A rabbit is located in one of these holes. Every ...
Stephen Williams's user avatar
8 votes
2 answers
267 views

I made this project that simulates a frozen yogurt shop, where you can pick your flavor, toppings, and sauces and then pay for it. I'm a beginner at python and this is my first project. I don't even ...
Nadia's user avatar
  • 81
2 votes
1 answer
304 views

I have implemented an option pricing algorithm following the Heston model. The simulation involves specifying the number of simulations, then generating a discretized path for each simulation (code ...
MattA's user avatar
  • 23
2 votes
1 answer
601 views

I've seen a lot of C++ simulators implementing logic gates, but absolutely all of them use the wrapped bitwise operations of the programming language itself. I have tried to omit the use of a bitwise ...
LXSoft's user avatar
  • 155
8 votes
1 answer
972 views

I watched a YouTube show the other day in which a variant of a Galton board is used to make a random selection from a range of movies that will be reviewed in that show. In contrast to a standard ...
Schmuddi's user avatar
  • 537
5 votes
4 answers
3k views

Below is the wording from the problem in Automate the Boring Stuff book. The bold text leads me to believe that I should be checking for a streak and not multiple streaks within each experiment of 100 ...
a-rizzo's user avatar
  • 51
3 votes
1 answer
298 views

I am studying Algorithms by Princeton University. The first week assignment is to simulate percolation by using Java. https://coursera.cs.princeton.edu/algs4/assignments/percolation/specification.php ...
yip's user avatar
  • 135
11 votes
1 answer
960 views

Below is some stripped down code from a physics simulation. The classes Vector2, Line and ...
Oliver Schönrock's user avatar
3 votes
1 answer
541 views

I have implemented the Barnes-Hut algorithm for \$n\$-body-simulations (in this case "sort-of" 3D-gravity - see below). I'd appreciate any comments for improving my code (especially ...
Paul Aner's user avatar
  • 131
6 votes
1 answer
880 views

I am making a pvz simulator. We have a game board with 1 = peashooter and 2 = zombie: ...
Alan Bagel's user avatar
2 votes
1 answer
455 views

This program simulates the phenomenon of aggregation of a swarm of robots with no cooperation between each other and each robot following a very simple rule: The velocity of this robot has a random ...
Caridorc's user avatar
  • 28.1k
1 vote
1 answer
321 views

I made the game of Life in C++ for a highschool class project. The website we're using doesn't have an autograder for C++, and my programming teacher doesn't really know how to program... so I'd love ...
digital_drako's user avatar
5 votes
1 answer
839 views

I created a quick monte-carlo simulation which seems to do what I want (simple version below). The code basically simulates a Poisson distribution, say this results in a simulation of ...
lmkir99's user avatar
  • 53

1
2 3 4 5
8