Commit 68c2406f authored by Benedikt Zoennchen's avatar Benedikt Zoennchen
Browse files

before change of the fmm update scheme

parent 968f0b8d
......@@ -11,6 +11,6 @@ public interface Triangulation<P extends IPoint> extends Iterable<Face<P>> {
Face<P> locate(final IPoint point);
Stream<Face<P>> streamFaces();
Set<Face<P>> getFaces();
void insert(final P point);
HalfEdge<P> insert(final P point);
void remove(final P point);
}
......@@ -8,11 +8,13 @@ import org.vadere.util.geometry.mesh.inter.IFace;
import org.vadere.util.geometry.mesh.inter.IHalfEdge;
import org.vadere.util.geometry.mesh.inter.IMesh;
import org.vadere.util.triangulation.ITriangulation;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.VCone;
import org.vadere.util.geometry.shapes.VLine;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VTriangle;
import org.vadere.util.math.InterpolationUtil;
import org.vadere.util.math.MathUtil;
......
......@@ -33,7 +33,8 @@ public class UniformTriangulation<P extends IPoint> extends DelaunayTriangulatio
this.pointConstructor = pointConstructor;
List<P> pointList = new ArrayList<>(generatePointSet());
//Collections.shuffle(pointList);
Collections.shuffle(pointList);
for(P point : pointList) {
insert(point);
}
......
......@@ -10,7 +10,7 @@ public class Parameters {
public final static double h0 = 0.15;
public final static boolean uniform = false;
public final static String method = "Distmesh"; // "Distmesh" or "Density"
final static double qualityMeasurement = 0.87;
final static double qualityMeasurement = 0.93;
final static double MINIMUM = 0.25;
final static double DENSITYWEIGHT = 2;
final static int NPOINTS = 100000;
......
......@@ -6,7 +6,7 @@ import org.vadere.util.geometry.shapes.VShape;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.*;
/**
* Created by Matimati-ka on 27.09.2016.
......@@ -33,22 +33,17 @@ public class TestEnhancedVersion extends JFrame {
// test.lineTo(30,30);
// VPolygon p = new VPolygon(test);
obstacles = new ArrayList<VShape>() {{
// add(new VRectangle(0.6*400, 0.6*400, 0.2*400, 5));
// add(new VRectangle(0.6*400, 0.65*400, 0.2*400, 5));
add(new VRectangle(0.65*300, -5, 0.1*300, 0.6*300));
add(new VRectangle(0.65*300, 0.7*300, 0.1*300, 0.3*300));
// add(p);
}};
ArrayList<VShape> fhIncluded = new ArrayList<VShape>() {{
// add(p);
// add(new VRectangle(0.6*400, 0.6*400, 0.2*400, 5));
// add(new VRectangle(0.6*400, 0.65*400, 0.2*400, 5));
add(new VRectangle(0.65*300, -5, 0.1*300, 0.6*300));
add(new VRectangle(0.65*300, 0.7*300, 0.1*300, 0.3*300));
double height = 300;
double width = 300;
java.util.List<VShape> boundingBox = new ArrayList<VShape>() {{
add(new VRectangle(0, 0, 5, width));
add(new VRectangle(0, 0, width, 5));
add(new VRectangle(width-5, 0, 5, height));
add(new VRectangle(0, height-5, 5, height));
}};
PSDistmesh meshGenerator = new PSDistmesh(bbox, obstacles, h0,false);
PSDistmesh meshGenerator = new PSDistmesh(bbox, boundingBox, h0,false);
System.out.println(System.currentTimeMillis()-now);
now = System.currentTimeMillis();
......@@ -95,9 +90,9 @@ public class TestEnhancedVersion extends JFrame {
graphics.fill(new VRectangle(0, 0, getWidth(), getHeight()));
graphics.setColor(Color.GRAY);
for(VShape obstacle : obstacles) {
/* for(VShape obstacle : obstacles) {
graphics.fill(obstacle);
}
}*/
graphics.setColor(Color.BLACK);
meshGenerator.getTriangles().stream().forEach(t -> graphics.draw(t));
......
......@@ -71,7 +71,7 @@ public class TestFFMNonUniformTriangulation {
VRectangle rect = new VRectangle(width / 2, height / 2, 100, 100);
targetAreas.add(rect);
EikonalSolver solver = new EikonalSolverFMMTriangulation(targetPoints, new UnitTimeCostFunction(), triangulation);
EikonalSolver solver = new EikonalSolverFMMTriangulation(targetAreas, new UnitTimeCostFunction(), triangulation, (x, y) -> new MeshPoint(x, y, false));
log.info("start FFM");
solver.initialize();
......
......@@ -112,7 +112,7 @@ public class TestBoyerWatson {
int height = 300;
Random r = new Random();
int numberOfPoints = 100000;
int numberOfPoints = 1000;
for(int i=0; i< numberOfPoints; i++) {
VPoint point = new VPoint(width*r.nextDouble(), height*r.nextDouble());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment