simulation

Are there any programs that can simulate an unstable network connection? [closed]

吃可爱长大的小学妹 提交于 2019-11-30 18:16:32
We need to simulate an unstable network connection to try to debug some connectivity issues in our server/client application and I was wondering if there are any programs out there that can simulate those conditions such as on a faint wireless network. I'm not just referring to reducing bandwidth, but also reducing reliability, frequent on and off, short bursts of disconnectedness, etc. I used a tool called netem that runs on linux. It allows you to increase packet loss at a given percentage, introduce delays within packets and handle packet re-ordering. Basically it's designed to emulate

Run a C# application from python script

元气小坏坏 提交于 2019-11-30 15:15:18
问题 I've just about finished coding a decently sized disease transmission model in C#. However, I'm fairly new to .NET and am unsure how to proceed. Currently I just double-click on the .exe file and the model imports config setting from text files, does its thing, and outputs the results into a text file. What I would like to do next is write a Python script to do the following: Run the simulation N times (N > 1000) After each run rename the output file and store (i.e. ./output.txt -> ./acc

Matlab/CUDA: ocean wave simulation

两盒软妹~` 提交于 2019-11-30 14:35:31
I've studied "Simulating Ocean Water" article by Jerry Tessendorf and tried to program the Statistical Wave Model but I didn't get correct result and I don't understand why. In my program I tried only to create a wave height field at time t = 0 without any further changes in time. After execution of my program I got not what I was expecting: Here's my source code: clear all; close all; clc; rng(11); % setting seed for random numbers meshSize = 64; % field size windDir = [1, 0]; % ||windDir|| = 1 patchSize = 64; A = 1e+4; g = 9.81; % gravitational constant windSpeed = 1e+2; x1 = linspace(-10,

Run a C# application from python script

感情迁移 提交于 2019-11-30 13:58:11
I've just about finished coding a decently sized disease transmission model in C#. However, I'm fairly new to .NET and am unsure how to proceed. Currently I just double-click on the .exe file and the model imports config setting from text files, does its thing, and outputs the results into a text file. What I would like to do next is write a Python script to do the following: Run the simulation N times (N > 1000) After each run rename the output file and store (i.e. ./output.txt -> ./acc/outputN.txt) Aggregate, parse, and analyze the outputs Output the result in some clean format (possibly

Is there a reason to initialize (not reset) signals in VHDL and Verilog?

ε祈祈猫儿з 提交于 2019-11-30 12:28:00
问题 I have never initialized signals. That way any signal missing a reset or assignment would be unknown or initialized. In some reference code they have initialization. This defeats what I wish. Also since intialization isn't synthesizable, there could be a simulation/synthesis mismatch. Is there any reason to initialize signals in this case? EDIT 6/17/11: As @Adam12 asked, this is for both storage (Verilog reg) and combinatorial (wire) elements. 回答1: (The following advice depends greatly on

Simulate “Newton's law of universal gravitation” using Box2D

吃可爱长大的小学妹 提交于 2019-11-30 12:16:13
问题 I want to simulate Newton's law of universal gravitation using Box2D. I went through the manual but couldn't find a way to do this. Basically what I want to do is place several objects in space (zero gravity) and simulate the movement. Any tips? 回答1: It's pretty easy to implement: for ( int i = 0; i < numBodies; i++ ) { b2Body* bi = bodies[i]; b2Vec2 pi = bi->GetWorldCenter(); float mi = bi->GetMass(); for ( int k = i; k < numBodies; k++ ) { b2Body* bk = bodies[k]; b2Vec2 pk = bk-

Problems Simulating Interarrival Times

点点圈 提交于 2019-11-30 10:30:51
I'm attempting to simulate the occurrence of an event (a vehicle entering a tunnel), which as it turns out is a Poisson process. I've broken the day up into 1 minute intervals, starting from 9am to 5pm. For each 1 minute interval, I've computed/obtained the mean: Number of vehicles that enter the tunnel during that period. Time between each vehicle entering the tunnel (expected interarrival time) For example for the minute 10:37-38 the mean is 5 vehicles with a mean inter-arrival time of 12seconds To sample the 10:37-38 minute I do the following: Sample a Poisson distribution with a mean of 5

How to emulate REPEAT() in SQLite

↘锁芯ラ 提交于 2019-11-30 08:32:46
问题 Most relational databases have some sort of REPEAT() string function, for instance: SELECT REPEAT('abc', 3) Would yield abcabcabc SQLite on the other hand has a very limited feature set. The functions supported by SQLite are listed here: http://www.sqlite.org/lang_corefunc.html Can REPEAT() be emulated with the functions available in SQLite? 回答1: A simplified version of @Lukas Eder's solution using hex() instead of quote: -- X = string -- Y = number of repetitions replace(hex(zeroblob(Y)),

Simulate “Newton's law of universal gravitation” using Box2D

雨燕双飞 提交于 2019-11-30 02:24:41
I want to simulate Newton's law of universal gravitation using Box2D. I went through the manual but couldn't find a way to do this. Basically what I want to do is place several objects in space (zero gravity) and simulate the movement. Any tips? It's pretty easy to implement: for ( int i = 0; i < numBodies; i++ ) { b2Body* bi = bodies[i]; b2Vec2 pi = bi->GetWorldCenter(); float mi = bi->GetMass(); for ( int k = i; k < numBodies; k++ ) { b2Body* bk = bodies[k]; b2Vec2 pk = bk->GetWorldCenter(); float mk = bk->GetMass(); b2Vec2 delta = pk - pi; float r = delta.Length(); float force = G * mi * mk

Simulating a key press event in Python 2.7

拟墨画扇 提交于 2019-11-30 00:55:47
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 win32com.client win32com.client.Dispatch("WScript.Shell").SendKeys('String to be typed') allow only to type strings from the script level but dont allow to press ENTER and other 'special' keys. Therefore my question is: How can I simulate any keyboard key press event from python script level including 'special' ones like ENTER, CTRL, ESC etc. It would be also very helpful if it is possible to hold a key