/************************************************************************************ * Copyright (C) 2008 by Politehnica University of Bucharest and Rutgers University * All rights reserved. * Refer to LICENSE for terms and conditions of use. ***********************************************************************************/ package vnsim.network.propagation; import java.io.BufferedReader; import java.io.FileReader; import java.io.File; import java.util.StringTokenizer; import java.util.Scanner; import java.io.IOException; import vnsim.map.object.Globals; public class Ricean { //vectors containig the Gaussian components from the txt file double[] data1,data2; //number of Gaussian components int n; double K; //max velocity of nodes , used in calculating the fm Doppler frequency double maxVelocity; double fm0,fs,dt,fm; public Ricean(String fileName,boolean isUrban) throws IOException { this.K=Globals.RICEAN_K; if(isUrban) this.maxVelocity=Globals.RICEAN_MAX_VELOCITY_URBAN; else this.maxVelocity=Globals.RICEAN_MAX_VELOCITY_FREE; this.fm=this.maxVelocity/Globals.DSRC_LAMBDA; this.fm0=this.fs=this.dt=0; this.loadDataFile(fileName); } //reading gaussian components from file public void loadDataFile(String fileName) throws IOException { //Scanner s=new Scanner(new File(fileName)); BufferedReader br=new BufferedReader(new FileReader(fileName)); this.n=Integer.parseInt(br.readLine()); this.fm0=(double)Integer.parseInt(br.readLine()); this.fs=(double)Integer.parseInt(br.readLine());; this.data1=new double[this.n]; this.data2=new double[this.n]; StringTokenizer st; for(int i=0;i