/************************************************************************************ * 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.vehicular.generator; import java.util.*; public class EntryFlowVariation { //sorted by time ArrayList times; //simulation time ArrayList flow; public EntryFlowVariation(){ times=new ArrayList (); flow=new ArrayList (); } public int getFirstValue() { if(flow.size()<0) return -1; return flow.get(0); } public void removeFirst() { times.remove(0); flow.remove(0); } public int getFirstMom() { if(times.size()==0) return -1; return times.get(0); } public void add(int mom, int val) { if(times.size()>0) { int last=times.get(times.size()-1); if(mom