Questions tagged [simulation]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1
votes
1answer
42 views

Pros and cons of position as properties of a spatial object?

Building games and simulation frameworks, it seems I am regularly hounded by this conundrum: Let's say you have a 2D grid, and you have an crate in that grid. I can put the coordinates on the crate, ...
-1
votes
3answers
195 views

Birthday Paradox, Analytical and Monte Carlo solutions give two systemically slightly different results [closed]

I was doing a Monte Carlo implementation of the Birthday Paradox in Python and I wanted to check if the results where the same as in the analytical implementation of the same problem (As they should ...
2
votes
2answers
85 views

Best practices for testing settings file with many parameters in simulation code

I'm conflicted as to what is the best way to approach this problem. I am writing a simulation in Python, which is parametrized by ~ 50 parameters. I have a JSON file where these parameters are set, ...
3
votes
5answers
669 views

Is there a way to speed up a big switch statement?

As a practice I'm working on a CPU simulator (runs at about 1.78MHz) and I'm using a switch statement to execute correct opcodes based on the value in the IR (instruction register) variable. This ...
0
votes
0answers
27 views

The optimal way to simulate vision detection from limited visual field

I need to build an experiment based on a scientific paper in which a high number of agents have a divided visual field (with limited detection distance) and have to detect other agents in a 2D ...
2
votes
1answer
127 views

Architecting a predictive modeling software

I have a predictive model which runs 10,000+ scenarios to predict the outcome. It's a micro-simulator model for an insurance company. The data part is almost static with changes from time-to-time, ...
-2
votes
1answer
459 views

Algorithm - Simulation of a soccer match

I'm implementing an App for fun. It consists of a soccer round-robin tournament simulator in which all teams play each other. A Team consists in a simple object: class Team{ String _teamName; ...
0
votes
1answer
88 views

Passing messages through a chain of containers in python

When I write python code for simulations, I often end up with the following situation: I have a class describing the general environment which contains a list of instances of a class that describes ...
0
votes
1answer
80 views

Logic circuit simulation: homebrew or third party solution?

Software I'm working on requires simulation of logic circuits, both combination and sequential. Now the simulation doesn't need to be too detailed, in fact it could be detrimental to the function of ...
1
vote
1answer
84 views

Simulating Comparison Without Using Comparison Primitives

In the same way that you can simulate the if statement and functions, I am wondering if there is a way to simulate the comparison operators ==, !=, >, >=, <, <=. For example, in ...
0
votes
2answers
208 views

How to Implement a `function` with `return` Without Using the `function` keyword

Along the lines of How to Simulate Control-Flow without using Control-Flow Primitives, I am wondering how to simulate return from a function. Given an example setup like this: console.log(a(10)) ...
1
vote
1answer
65 views

Displaying periodic simulations via web interface

The gist of my problem is that I'm trying to make a basic simulation for periodically collected data. More specifically, given the position of a radio antenna, the RF patterns would be simulated ...
0
votes
0answers
57 views

Program Simulation Techniques

I've noticed that data-flow analysis uses approximations of a programs steps by simulating the value flow in some way (which I don't fully understand yet). They describe it well here. On page 4 they ...
4
votes
1answer
223 views

Massive Simulator Software Architecture [closed]

I am looking to perform a large overhaul on a complex simulation system that simulates several instances of several vehicle models in a classroom training environment. For example, 24 students may be ...
1
vote
2answers
282 views

Good practice to store runtime data

Cheers guys, I am quite new to C++, however, I have some years of experience in programming and I am open for challenges :-) Currently, I am designing a "small" scientific program to perform some ...
0
votes
1answer
676 views

Design Pattern similar to ESB

Background I am trying to write a simulator where multiple AI agents are competing and/or collaborating to achieve the goal of maximizing some utility function. Each agent has the ability to interact ...
3
votes
3answers
280 views

How to simulate living things in software [closed]

I was thinking about creating a simple game/simulation where cars drive around in a city as part of a pet project. That made me think how I would simulate these individual cars in a simulated world. ...
-1
votes
1answer
102 views

How should I represent an object whose instances share the same set of member function identifiers, but those identifiers specify different behaviors?

I'm attempting to develop an open-source Python module for modeling task networks for discrete event simulation. The most fundamental component is the task object, which includes various data such as ...
3
votes
3answers
401 views

How to create simulator for distributed algorithms written in simple language

I started development of simulator for simulation of distributed algorithms in language C. My work consist of creating simple language for algorithm description and simulator which takes the described ...
1
vote
1answer
362 views

When implementing Monte Carlo Tree Search for TicTacToe, do I simulate won states?

I'm trying to debug my MCTS implementation for TicTacToe (it doesn't block obvious wins for the opponent). I was wondering what the algorithm should do if it expands to a node which is a game over ...
1
vote
1answer
211 views

Good design for modular computational physics code in Fortran

I'm currently working on a computational physics code in Fortran. In summary, the code performs the following operations: Initialize Loop until done Advance solution over time Possibly write output ...
31
votes
4answers
25k views

What algorithm is used by elevators to find the shortest path to travel floor orders?

I'm trying to simulate an elevator, as always I started very simple by taking only a single order at a time, then added memory to the elevator in the form of queues so that floors are traveled in the ...
1
vote
0answers
253 views

Running simulations in parallel, managing each separately [closed]

Let me preface this by admitting that I am a novice - this is the first real project I am doing outside of a class. I am running a single-threaded C++ simulation several hundred times (i.e. I have ...
2
votes
3answers
4k views

Linking two or more different programming languages

I would like to ask how optimizer software written in C/C++ can be linked to simulator software written in FORTRAN or any other language. I have copied the section of journal article of Singh and ...
4
votes
1answer
1k views

Parking Simulation Software Design

I've been requested to develop a quite well known problem for a job interview. The Parking Simulation which an example can be found here. I came up with some ideas for which design pattern should I ...
1
vote
2answers
459 views

Simulating a Production Line

I'm trying to simulate a DVD production line in Java. The thing I have a problem with is the calculation of the time in this kind of simulation and the number of DVDs per hour. The production line ...
1
vote
0answers
40 views

modelling an ecosystem evolving on a landscape

I would like to understand a bit more the theory and the approaches available in modelling a population roaming across a landscape. Assume discrete time and space as simple as a discrete grid and a ...
1
vote
1answer
381 views

Implementing a VM for simulation [closed]

I am aware of this question, and I think I know why it has been closed. I hope that my question manages to be more specific. My skill level: I have a "Computer Science" degree. I have programmed in ...
-2
votes
2answers
4k views

Using a global struct with pthreads in C [closed]

I'm trying to simulate clients going into a bank and being served by tellers over a period of time. I am using a thread to determine if a client came into the bank via an arrival rate and am using ...
0
votes
1answer
85 views

No repeated coordinates in random walker ensemble

i'm simulating an ensemble of random walkers in 2D in python, I set [x,y] coordinates of my walkers to be gaussian in a 2D grid, then use a rand array of -1 and +1 to move up down left right: N=20 #...
0
votes
2answers
107 views

How to predict a future simulation state

We have a program that combines the simulation of an aircraft system and predefined pedagogical scenarios for trainee pilots to learn how to use this system. When we follow the normal scenario, ...
4
votes
1answer
149 views

How to define the motion path of one object on a surface of the other one?

I have an uncommon problem. There are 2 3D objects, which are represented by arrays of vertices and triangles (.stl files). Each of them contains a big enough amount of vertices: 1-10 mln ones. The ...
0
votes
2answers
585 views

Looking to simulate the rolling of a ball around a roulette wheel, while the resulting number is already known

I want to make a roulette board with a ball spinning and landing on a certain field. The catch is that the field the ball will land on, is known beforehand. I want the animation to look somewhat ...
0
votes
1answer
169 views

How should I handle measurement logging in my Discrete Event Simulation engine?

I'm attempting to build a Discrete Event Simulation library by following this tutorial and fleshing it out. How should I handle logging metrics in my Discrete Event Simulation engine? If you don't ...
0
votes
1answer
1k views

How to simulate an ATM terminal in a POS

Recently I started same projects to improve my programming skills, so I tried to develop a point of sale software. I started to bay the required hardware (ticket printer, Barcode Scanner….) to make my ...
3
votes
6answers
607 views

Design pattern for method to accept one of several static items in C#?

I want to illustrated my question by way of a (hopefully) representative example. Lets say I have a situation where I am developing a class library in C# to be used in some simulations. I want to ...
1
vote
2answers
88 views

Determinining “value” in multi-agent microeconomical simulation

I am trying to determine an objective way for a self-interested agent to calculate the optimal buying/selling price for goods in a multi-agent simulation not dissimilar to Sugarscape (http://en....
1
vote
3answers
201 views

Microeconomical simulation: coordination/planning between self-interested trading agents

In a typical perfect-information strategy game like Chess, an agent can calculate its best move by searching the state tree for the best possible move, while assuming that the opponent will also make ...
2
votes
1answer
844 views

Shuffling algorithm with no “self-mapping”?

To randomly shuffle an array, with no bias towards any particular permutation, there is the Knuth Fischer-Yeats algorithm. In Python: #!/usr/bin/env python import sys from random import randrange ...
19
votes
5answers
667 views

Algorithm to Find the Aggregate Mass of “Granola Bar”-Like Structures?

I'm a planetary science researcher and one project I'm working on is N-body simulations of Saturn's rings. The goal of this particular study is to watch as particles clump together under their own ...
9
votes
2answers
2k views

How would I combine 'Command' and 'Composite' to simulate a time delay?

As a learning exercise (I am not in school - just an old guy trying to learn something new), I am trying to write a logic gate simulation that incorporates propagation delay. The user should also be ...
1
vote
2answers
84 views

Evaluating mean and std as simulations are added

I have simulations that evaluate a certain value X. I run the simulations several times and save the value of X in a vector V. When all the runs have finished I evaluate the mean and standard ...
8
votes
2answers
1k views

Is there any better approach to shortest path finding within a (vehicular) traffic network?

Dear fellow programmers, We're developing software which simulates vehicular traffic. Part of the process called "assignment" is concerned with assigning vehicles to their routes and has to use some ...
4
votes
1answer
531 views

How to implement a simulation pattern for a repository?

Let's say I have a repository of functions. These functions work with business objects within a database, CMS or other third party API. For example, my repository interacts with virtual files and ...
3
votes
2answers
804 views

Efficient ways to model cars moving along a road

This has never come up, so I've never thought how a data or programming model should work that simulates (a) bird's eye view of cars moving and some rudimentary physics, (b) how the cars would follow ...
6
votes
2answers
2k views

Best approach to selecting programming languages and 3D graphics API for simulating physics experiments

I am starting a research project and need to nail down a programming language and 3D graphics API where I will be creating an environment in the field of molecular cell biology where I will be ...
98
votes
6answers
149k views

What's the difference between simulation and emulation

I frequently see Simulation and Emulation in computer science. These two terms seem synonymous. Is there any difference between Simulation and Emulation?
1
vote
3answers
2k views

Simulating double-click, how long should I wait between clicks?

I'm simulating a double click programmatically and I want to have a slight pause between both clicks in order to better simulate a real user. I know the interval should be less than ...
11
votes
3answers
25k views

elevator algorithm and implementation [closed]

I wanted to know how (real) elevators work. But, so far, I could not find much material about the algorithms they use, nor software (if any) for simulation. Could anybody give me references for that?
4
votes
4answers
251 views

Parameterize Agent Based Simulation (OOP-Question)

I'd like to hear my fellow programmer's thoughts on the issue of parametrizing agent based simulations: Consider: Simulation core, including geometry, collision tests, some rules Different agents (...