simulation

How can CAS simulators like PTLsim achieve cycle accurate simulation of x86 hardware?

混江龙づ霸主 提交于 2019-12-09 03:42:14
问题 Can somebody enlighten me how does CAS software like http://www.ptlsim.org/ work? How do they achieve cycle accuracy if there is neither information how many cycles are used per instruction nor CPU branch prediction logic is known? Or is everything available over NDAs? I suppose they probably can be pretty accurate with caches being hit or missed (maybe I'm wrong but I think it's easier to predict the internal algorithm), but without knowledge how pipelining and superscalarity are implemented

Parallel loops and Random produce odd results

霸气de小男生 提交于 2019-12-08 19:08:47
问题 I just started playing with the Task Parallel Library, and ran into interesting issues; I have a general idea of what is going on, but would like to hear comments from people more competent than me to help understand what is happening. My apologies for the somewhat lengthy code. I started with a non-parallel simulation of a random walk: var random = new Random(); Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); var simulations = new List<int>(); for (var run = 0; run < 20; run++) {

Framework for distributed computing for .Net / Mono that supports persistence of distributed tasks

淺唱寂寞╮ 提交于 2019-12-08 11:24:29
问题 I'm looking for a framework (open source) for distributed computing for .Net / Mono that is not simply task-based but supports persistence of distributed tasks. The project at hand is a complex system simulation which needs to be distributed into smaller independent "subsimulations". These subsimulations will keep running for a long time and will at intervals receive and send back data to the Master where a View with aggregate results is being updated and presented to the user. So the work to

How to get count of cars in specific range

时光总嘲笑我的痴心妄想 提交于 2019-12-08 06:09:02
问题 In veins i'm trying to simulate a VANET scenario in which if road is blocked then after specific time the car broadcast a message including blocked roadId and count of vehicles around it's 100 meter. In TraCIDemo11p application when the car is stopped for longer than 10 seconds it changes the node color to red (to show an accident) and sends a message out to other cars containing the blocked road id, all this is done in handlePositionUpdate mehtod: findHost()->getDisplayString().updateWith("r

Use facet_grid option to plot column of dataframe with ggplot2

北慕城南 提交于 2019-12-08 04:56:44
问题 I get some result from simulation, and i want to make a facetting like this diagram below, and i don't know if it's possible to make this with ggplot2 and the facet_grid option. My result for simulations have this "simplified" form, one line by simulation : dat <- read.table(textConnection("P1 P2 P3 P4 R 1 2e-5 1.0 0.6 3 1 2 4e-6 1.5 0.7 1.5 2 3 6e-7 1.2 0.6 2.5 3 4 8e-8 1.45 0.65 3.2 4 ")) And here you can see the simplified graphic i want to produce with ggplot2 and facet_grid I have one

Python, SimPy: Using yield inside functions

有些话、适合烂在心里 提交于 2019-12-08 03:56:45
问题 Helo, I'm building a relatively complex Discrete Event Simulation Model in SimPy. When I try to put my yield statements inside functions, my program doesn't seem to work. Below shows an example. import SimPy.SimulationTrace as Sim import random ## Model components ## class Customer(Sim.Process): def visit(self): yield Sim.hold, self, 2.0 if random.random()<0.5: self.holdLong() else: self.holdShort() def holdLong(self): yield Sim.hold, self, 1.0 # more yeild statements to follow def holdShort

Time synchronization in java

巧了我就是萌 提交于 2019-12-07 17:05:57
问题 Inside a for-loop I'm controlling the simulation-step-based traffic simulator SUMO by retrieving and processing information of vehicles. To make sure that my program simulates in "real-time" (1 simulation-step = 1 second) I want to sleep my program after the processing phase until the next time step begins. To get better results I'm calculating the time stamp based on a initially taken reference time stamp. The loop looks like this: System.out.println("start of traffic simulation ..."); for

Python logging: override log time

我与影子孤独终老i 提交于 2019-12-07 08:27:22
问题 Following Python's documentation, I'm trying to override logging.Formatter.converter in order to control the time logged. As you can see below - the milliseconds were not overriden (they are the current time milliseconds). How come? How can I control the milliseconds as well? >>> import logging, datetime >>> formatter = logging.Formatter('%(asctime)s:%(message)s') >>> handler = logging.StreamHandler() >>> handler.setFormatter(formatter) >>> def sim_time(t): ... return datetime.datetime(2000,1

full precision may not have been achieved in 'qbeta'

∥☆過路亽.° 提交于 2019-12-07 03:52:16
问题 I am running R version 2.14.0 on a PC which uses Windows 7 Ultimate (Intel Core i5-2400 3GHz processor with 8.00GB ram). Let me know if other specs needed. I am trying to simulate correlated beta distributed data. The method I am using is an extension of what is written in this paper: http://onlinelibrary.wiley.com/doi/10.1002/asmb.901/pdf Basically, I start by simulating multivariate normal data (using mvrnorm() function from MASS). Then I use pnorm() to apply the probit transform to these

plotting package for c++

折月煮酒 提交于 2019-12-07 02:11:57
问题 I have got a question about plotting package for c++. For last few years I was using python and matplotlib, right now I am using c++ and I would like to find something similar to matplotlib (http://matplotlib.sourceforge.net/gallery.html) like 2d, 3d plots, histograms and so on and so on. I just want to know Your recommendation. Best regards, nykon 回答1: I again would recommend gnuplot. If you don't want to use it then I liked plplot when I used it: http://plplot.sourceforge.net/ . The canvas