package RS06; import java.util.*; import java.io.*; public class Blatt_5 { static Random r = new Random(); // Erzeugt eine mit Parameter lambda Poisson-verteilte ZV // als Summe von Exp-verteilten ZV public static int poisson(double lambda) { int count = 0; double e = -Math.log(r.nextDouble()); while (e <= lambda) { count++; e -= Math.log(r.nextDouble()); } return count; } // Erzeugt eine Realisierung eines Poisson-Prozesses mit Intensitaetsfunktion f // im Fenster (x_axis[0],x_axis[1]) X (y_axis[0], y_axis[1]) public static Vector PoissonProcess(double[] x_axis, double[] y_axis, intensityFunction f) { Vector points = new Vector(); double x_length = x_axis[1] - x_axis[0]; double y_length = y_axis[1] - y_axis[0]; // Bestimme Anzahl der Punkte int number_of_points = poisson(f.max()*x_length*y_length); for(int i=0; i0){ result[j]=D/lambda_H; D=0; lambda_H=0; } else{ result[j]= -1; D=0; lambda_H=0; } } return result; } /* * Prozedur liest eine Liste von doubles, die in einer Textdatei gespeichert sind, in einen Array ein und * gibt diesen zurück */ public static double[] get_from_file(String path){ double[] dummy= new double[1]; Vector objects=new Vector(); try{ FileReader r=new FileReader(path); BufferedReader in = new BufferedReader(r); String s; s=in.readLine(); while(s!=null){ objects.add(s); s=in.readLine(); } double[] result= new double[objects.size()]; for(int i=0; iD[j-1] || upper[j-1]