Tagged Questions
0
votes
2answers
51 views
How to check if balls in a list collide, and remove them from list
So I have a Ball class that looks like this:
class Ball(object):
def __init__(self,n,x0,y0,dx,dy,r,c):
self.xc = x0
self.yc = y0
self.dx = dx
self.dy = dy
...
2
votes
3answers
71 views
Python giving same result when I call a function multiple times, despite random component
I am writing a baseball game simulation. I would like to be able to run multiple games to see how different batting averages affect outcomes. Each game is made up of "at-bats", the result of which ...
2
votes
0answers
79 views
How to control a simulation in Python
I have a fairly high-level question about Python and running interactive simulations. Here is the setup:
I am porting to Python some simulation software I originally wrote in Smalltalk (VW). It is a ...
0
votes
0answers
60 views
Python odeint integration error, gravity n body simulation
from numpy import array, linspace, asarray
from numpy.random import rand
from scipy.integrate import odeint
from visual import mag
# no of particles
P = 3
# initial ...
0
votes
1answer
56 views
For loop not working as it should in the simulation
Here is a code that I created in python (fairly new to it).
I am trying to make a simulation for biofilms, but before I take it to implementing the actual algorithms (mathematical formulas for ...
1
vote
1answer
91 views
Emulate Touch Event in Windows 8 using Python
I am trying to write a sort of driver using python for windows 8. I will be receiving touch coordinates via serial which I then want to use to make it appear as though someone touched those ...
1
vote
1answer
100 views
Simulating 1K web clients with different mac addresses as sources
I have the following need:
Simulate 1K (or more) web clients (i.e., http requests) to an ip address.
Each client has to use a different mac as source.
Solution has to be somewhat realistic, ...
2
votes
1answer
87 views
For a simulation system, which data structure is most suitable?
I am in the planning phase of building a simulation and need ideas on how to represent data, based on memory and speed considerations.
At each time-step, the simulation process creates 10^3 to 10^4 ...
2
votes
1answer
131 views
Why is my astronomy simulation inaccurate?
I've made a program that simulates movement of bodies in the solar system, however, I'm getting various inaccuracies in my results.
I believe that it probably has something to do with my integration ...
-2
votes
1answer
47 views
Framework for visualization of simulation [closed]
I'm currently working on a task, a simulation of robots moving in a two-dimensional plane, to be more specific. I've got to visualize their movement over time, but I'm not quite sure which framework ...
2
votes
1answer
258 views
Ant colony simulation - optimizing the path [closed]
I am trying to build a simple ant colony simulation. The world is grid of squares; each one of them can consist of some level of pheromone and any number of ants. There are 2 types of pheromone: food ...
2
votes
1answer
330 views
Python Monte Carlo Simulation Loop
I am working on a simple Monte-Carlo simulation script, which I will later on extend for a larger project. The script is a basic crawler trying to get from point A to point B in a grid. The ...
1
vote
4answers
476 views
Recursion in Python? RuntimeError: maximum recursion depth exceeded while calling a Python object [duplicate]
Possible Duplicate:
Maximum recursion depth?
I have another problem with my code.
I'm wrtiting my first program in Vpython and I have to make a simulation of mixing two gases. First i had ...
1
vote
2answers
105 views
Recursion in Python: what am I doing wrong?
I'm writing my first program in python and it has to simulate the mixing of particles (two gases). I don't know what am I doing wrong with this function.
I don't want the particles to leave certain ...
1
vote
0answers
590 views
Simulating a key press event in Python 2.7
What I want to do is to press any keyboard key from the Python script level on Windows. I have tried SendKeys but it works only on python 2.6. Other methods that I have tried including
import ...
1
vote
1answer
61 views
Optimize Class Simulation Code?
I created a class that effectively deals a playing card at random from a 52 card deck. I then wrote a few lines to simulate 100K simulations of 52 draws because I was wondering if the distribution ...
-3
votes
1answer
62 views
Python/Pygame: relativity to objects and object size [closed]
I am looking to create a game using pygame, but the main problem is simulating the distance from different objects at a first person standpoint.
For example, an airplane take-off runway, where the ...
3
votes
2answers
150 views
How to determine the amplitude and the frequency of an “oscillating” trajectory
This is the trajectory of a pedestrian moving in jam
As you can see, his/her head perform an oscillation-like movement. So not a perfect sinus curve but neither a line.
Is it possible to define for ...
0
votes
0answers
55 views
Python SimPy: How to split or copy customers?
Here is what I'm trying to implement in SimPy:
Customers firstly enter Server A for 5 minutes of service. Then each customer is split into two, one goes to Server B for 3 minutes of service, one goes ...
2
votes
0answers
46 views
searching for fem-library [closed]
I create programs for finite element simulation of electric machines. In such programs it is convenient to consider rotor and stator in their own frame of reference and to simulate the rotor ...
1
vote
1answer
126 views
Python code translation issue or language difference in random number generation
I'm new to Python and have no experience with QBasic. I was running a simulation in Python that came up with theoretically wrong values. I then ran it in QBasic and came up with theoretically ...
0
votes
0answers
140 views
Python (SimPy - Simulation) speed performance [closed]
I opt to implement a very simple open-source discrete event simulation package to model enterprise (manufacturing/logistics etc) procedures. As I said I want it to be simple, but expandable. I spent ...
0
votes
0answers
117 views
Scheduling resources for discrete event simulation in simpy
I am coding a discrete event simulation in python and am having trouble managing resources. I found some example code on http://simpy.sourceforge.net/changingcapacity.htm
This code assigns break ...
0
votes
1answer
343 views
war card game simulation in python
Hi you might remember this program if you are a regular here. I have solved many of the bugs but am stumped by one. The error is:
File "/Users/administrator/Desktop/war.py", line 62, in ...
-3
votes
1answer
112 views
bugs in my card game simulation script
I know its frowned upon to ask questions like this here but i cant seem to work out all the bugs out of my python script. it simulates a game of war (card game). it should work perfectly, i think. I ...
1
vote
2answers
126 views
Small issue in code execution, python card game simulation
To whom this may concern,
This is some code to a card game simulation. (The game of war). When I run it I receive this error:
player0.append(player1[range(warcard1 + 1)]
^
SyntaxError: ...
1
vote
2answers
142 views
Is there a simulation framework for django applications? What are the good practices to write one?
So, I have an idea.
Suppose you have classic application that consists of several classes of users and some data they working with. Let's say that it is Passengers, Drivers and Dispatchers (as in ...
1
vote
2answers
275 views
Probability Simulation in Python
I was given a probability problem, and I wrote a script to test it.
Two unbiased dice are thrown once and the total score is observe. Find de probabiity that:
a) The total score is even or greater ...
0
votes
1answer
65 views
printing out dictionnaires
I have a rather specific question:
I want to print out characters at a specific place using the \033[ syntax. This is what the code below should do: (the dict cells has the same keys as coords but ...
3
votes
3answers
155 views
Preferred (or recommended) way to store large amounts of simulation configurations, runs values and final results
I am working with some network simulator. After making some extensions to it, I need to make a lot of different simulations and tests. I need to record:
simulation scenario configurations
values of ...