/************************************************************************************ * Copyright (C) 2008 by Politehnica University of Bucharest and Rutgers University * All rights reserved. * Refer to LICENSE for terms and conditions of use. ***********************************************************************************/ //Petroaca - object which measures the interference and noise on the station for the duration of a frame package vnsim.network.dsrc; import vnsim.map.object.Globals; public class NoiseMonitor { private double InterferenceAndNoiseLevel; // the Signal to Interference/Noise Ratio threshold //the natural noise an antenna experiences private double thermalNoise; //constructor - initialising the IAndN with the value of the thermalNoise and the SINRThreshold with the value best suited for the type of modulation public NoiseMonitor(double thermalNoise) { this.thermalNoise=thermalNoise; this.InterferenceAndNoiseLevel=this.thermalNoise; } //when the frame time changes the interference returns to its initial value public void refreshInterference() { this.InterferenceAndNoiseLevel=this.thermalNoise; } public void addInterference(double receivedPower) { this.InterferenceAndNoiseLevel+=receivedPower; } public double getInterference() { return this.InterferenceAndNoiseLevel; } public double getThermalNoise() { return this.thermalNoise; } }