Package utils
Class OTMUtils
- java.lang.Object
-
- utils.OTMUtils
-
public class OTMUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static double
epsilon
static long
lane_group_counter
static long
vehicle_id_count
-
Constructor Summary
Constructors Constructor Description OTMUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
approximately_equals(double x, double y)
static <T> String
comma_format(Collection<T> x)
static List<Double>
csv2list(String csstr)
static List<Long>
csv2longlist(String csstr)
static <T> boolean
equals(Collection<T> A, Collection<T> B)
static String
format_delim(double[] array, String delim)
static <T> String
format_delim(T[] array, String delim)
static long
get_lanegroup_id()
static long
get_vehicle_id()
static Float
get_waiting_time(double rate, StochasticProcess process)
static boolean
greater_than(double x, double y)
static <T> HashSet<T>
hashset(T x)
static <T> List<T>
init_list(int n, T val)
static int[]
int_hash_int(String str)
static <T> Set<T>
intersect(Collection<T> A, Collection<T> B)
static int
min(int a, int b)
static double
random_double(double min, double max)
static int
random_int(int min, int max)
static double
random_zero_to_one()
static ArrayList<Double>
read_double_csv_file(File file)
static int[][]
read_int_table(String str)
static LaneGroupSet
read_lanegroups(String str, Map<Long,Link> links)
static int[]
read_lanes(String str, int full_lanes)
static ArrayList<ArrayList<Double>>
read_matrix_csv_file(File file)
static void
reset_counters()
static <T> T
sample_from_set(Set<T> set)
static void
set_random_seed(long seed)
static <T> Set<T>
setminus(Collection<T> A, Collection<T> B)
static double
snap_to_grid(double x, double gridsize)
static double
sum(Collection<Double> X)
static <T> double
sum(Map<T,Double> X)
static List<Double>
times(List<Double> X, Double a)
static List<Float>
times(List<Float> X, Float a)
static <T> Map<T,Double>
times(Map<T,Double> X, Double a)
static double[]
toDoubleArray(List list)
static float[]
toFloatArray(List list)
static long[]
toLongArray(List list)
static String
write_int_table(int[][] table)
-
-
-
Method Detail
-
reset_counters
public static void reset_counters()
-
set_random_seed
public static void set_random_seed(long seed)
-
hashset
public static <T> HashSet<T> hashset(T x)
-
toDoubleArray
public static double[] toDoubleArray(List list)
-
toFloatArray
public static float[] toFloatArray(List list)
-
toLongArray
public static long[] toLongArray(List list)
-
init_list
public static <T> List<T> init_list(int n, T val)
-
min
public static int min(int a, int b)
-
approximately_equals
public static boolean approximately_equals(double x, double y)
-
greater_than
public static boolean greater_than(double x, double y)
-
sum
public static double sum(Collection<Double> X)
-
get_waiting_time
public static Float get_waiting_time(double rate, StochasticProcess process)
-
random_int
public static int random_int(int min, int max)
-
random_double
public static double random_double(double min, double max)
-
random_zero_to_one
public static double random_zero_to_one()
-
snap_to_grid
public static double snap_to_grid(double x, double gridsize)
-
sample_from_set
public static <T> T sample_from_set(Set<T> set)
-
intersect
public static <T> Set<T> intersect(Collection<T> A, Collection<T> B)
-
setminus
public static <T> Set<T> setminus(Collection<T> A, Collection<T> B)
-
equals
public static <T> boolean equals(Collection<T> A, Collection<T> B)
-
int_hash_int
public static int[] int_hash_int(String str)
-
comma_format
public static <T> String comma_format(Collection<T> x)
-
read_lanes
public static int[] read_lanes(String str, int full_lanes)
-
read_lanegroups
public static LaneGroupSet read_lanegroups(String str, Map<Long,Link> links) throws OTMException
- Throws:
OTMException
-
read_int_table
public static int[][] read_int_table(String str)
-
write_int_table
public static String write_int_table(int[][] table)
-
get_lanegroup_id
public static long get_lanegroup_id()
-
get_vehicle_id
public static long get_vehicle_id()
-
-