コード例 #1
0
bands = [0.0, 1, 2, 50.0]
weights = [1, 0]

# Simulate the transmission and part of the reconstruction
startTimeTotal = time.time()
testData = []
staticJumps = [ [ [], [], [] ], 
			    [ [], [], [] ],
				[ [], [], [] ],
			    [ [], [], [] ] ]
for inputFile in inputFiles:
	simulationData = sim.simulateTransmission(inputFile, logDir, predictionInterval, 
											  samplingInterval, heartbeat, drThreshold, 
											  delay, jitter, packetLoss)
	simNumber = inputFile.split('/')[-2][-1]
	snapReconstruction = sim.simulateSnapRecon(simulationData[4], logDir, simNumber, samplingInterval)[0]
	snapLimitReconstruction = sim.simulateSnapLimitRecon(simulationData[4], logDir, simNumber, samplingInterval,
														 interpolationType, closeThreshold, snapLimit)[0]
	convergedReconstruction = sim.simulateLinearConvergence(simulationData[4], logDir, simNumber, samplingInterval,
						  			                 		interpolationType, closeThreshold)[0]
	testData.append([simulationData[0], simulationData[4], snapReconstruction, 
					 snapLimitReconstruction, convergedReconstruction])
	
	# Find intra-sample jump
	threshold = 0
	spacing = 1
	jumpDataSets = []
	jumpDataSets.append( sim.findDistanceBetweenSamples(simulationData[0], threshold, spacing) )
	jumpDataSets.append( sim.findDistanceBetweenSamples(snapReconstruction, threshold, spacing) )
	jumpDataSets.append( sim.findDistanceBetweenSamples(snapLimitReconstruction, threshold, spacing) )
	jumpDataSets.append( sim.findDistanceBetweenSamples(convergedReconstruction, threshold, spacing) )
コード例 #2
0
errors = []
deltaInput = []
deltaSnap = []
deltaConverge = []

# Simulate the transmission
simulationData = sim.simulateTransmission(inputFile, logDir, predictionInterval, 
										  samplingInterval, heartbeat, drThreshold, 
										  delay, jitter, packetLoss)
inputData = simulationData[0]
deltaInput = sim.findDistanceBetweenSamples(inputData, jumpThreshold, spacing)
																			
for reconThreshold in reconThresholds:
	convergeTxData = sim.simulateLinearConvergence(simulationData[4], logDir, "_ex1", samplingInterval,
										   	   	   interpolationType, reconThreshold)
	snapRxData = sim.simulateSnapRecon(simulationData[4], logDir, "_ex1", samplingInterval)
	errors.append( sim.findDistanceError(inputData, convergeTxData[0]) )
	deltaSnap.append( sim.findDistanceBetweenSamples(snapRxData, jumpThreshold, spacing) )
	deltaConverge.append( sim.findDistanceBetweenSamples(convergeTxData, jumpThreshold, spacing) )

# Prepare the data for plotting
temp = []
for error in errors:
	temp.append( scipy.stats.mean(error) )
errors = temp

#pylab.figure(1)
#pylab.plot(reconThresholds, errors)
pylab.figure(2)
n, bins, patches = pylab.hist(deltaInput, 50)