The name of the initial branch for new projects is now "main" instead of "master". Existing projects remain unchanged. More information: https://doku.lrz.de/display/PUBLIC/GitLab

Commit 5068961f authored by Benedikt Zoennchen's avatar Benedikt Zoennchen
Browse files

additional javadoc.

parent cdf290e5
......@@ -5,10 +5,13 @@ import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.meshing.mesh.gen.DelaunayHierarchy;
import org.vadere.meshing.utils.debug.DebugGui;
import org.vadere.meshing.utils.debug.SimpleTriCanvas;
import org.vadere.util.geometry.GeometryUtils;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.VPoint;
import java.awt.*;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.Optional;
......@@ -1452,12 +1455,6 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
*/
V v = getMesh().streamVertices(face).min(Comparator.comparingDouble(p::distance)).get();
/*SimpleTriCanvas canvas = SimpleTriCanvas.simpleCanvas(getMesh());
getMesh().streamFaces(v).forEach(f -> canvas.getColorFunctions().overwriteFillColor(f, Color.MAGENTA));
if(DebugGui.isDebugOn()) {
DebugGui.showAndWait(canvas);
}*/
/**
* Get the face with the centroid closest to p and which was not visited already.
*/
......@@ -1466,6 +1463,13 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
.filter(f -> !visitedFaces.contains(f))
.min(Comparator.comparingDouble(f -> p.distance(getMesh().toPolygon(f).getCentroid())));
SimpleTriCanvas canvas = SimpleTriCanvas.simpleCanvas(getMesh());
getMesh().streamFaces(v).forEach(f -> canvas.getColorFunctions().overwriteFillColor(f, Color.MAGENTA));
DebugGui.setDebugOn(true);
if(DebugGui.isDebugOn() && !closestFace.isPresent()) {
DebugGui.showAndWait(canvas);
}
assert closestFace.isPresent() : visitedFaces.size();
return closestFace;
}
......
......@@ -36,9 +36,9 @@ public abstract class TriCanvas
extends Canvas {
static final Logger log = LogManager.getLogger(TriCanvas.class);
static final VRectangle defaultBound = new VRectangle(-11, -11, 11, 11);
static final int defaultWidth = 1200;
static final int defaultHeight = 920;
static final VRectangle defaultBound = new VRectangle(0,0,10,10);
static final int defaultWidth = 500;
static final int defaultHeight = 500;
protected final IMesh<P, V, E, F> mesh;
public double width;
......
......@@ -10,7 +10,7 @@ import org.vadere.simulator.projects.io.TrajectoryReader;
import org.vadere.state.attributes.scenario.AttributesAgent;
import org.vadere.state.scenario.Agent;
import org.vadere.state.simulation.Step;
import org.vadere.tests.util.reflection.TestResourceHandler;
import org.vadere.simulator.utils.reflection.TestResourceHandler;
import org.vadere.util.io.IOUtils;
import java.io.File;
......
......@@ -8,9 +8,9 @@ import org.junit.Test;
import org.vadere.simulator.entrypoints.cmd.SubCommand;
import org.vadere.simulator.entrypoints.cmd.VadereConsole;
import org.vadere.simulator.projects.migration.MigrationAssistant;
import org.vadere.tests.util.reflection.TestJsonNodeExplorer;
import org.vadere.tests.util.reflection.TestJsonNodeHelper;
import org.vadere.tests.util.reflection.TestResourceHandler;
import org.vadere.simulator.utils.reflection.TestJsonNodeExplorer;
import org.vadere.simulator.utils.reflection.TestJsonNodeHelper;
import org.vadere.simulator.utils.reflection.TestResourceHandler;
import java.nio.file.Files;
import java.nio.file.Path;
......
......@@ -5,6 +5,7 @@ import org.apache.log4j.Logger;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.vadere.meshing.mesh.gen.MeshPanel;
import org.vadere.meshing.mesh.gen.PFace;
import org.vadere.meshing.mesh.gen.PHalfEdge;
import org.vadere.meshing.mesh.gen.PVertex;
......@@ -35,7 +36,7 @@ public class TestFFMUniformTriangulation {
private IIncrementalTriangulation<IPotentialPoint, PVertex<IPotentialPoint>, PHalfEdge<IPotentialPoint>, PFace<IPotentialPoint>> uniformTriangulation;
private int width = 10;
private int height = 10;
private double minTriangleSideLength = 0.4;
private double minTriangleSideLength = 1.0;
@Before
public void setUp() throws Exception {
......@@ -55,6 +56,14 @@ public class TestFFMUniformTriangulation {
targetPoints.add(new EikMeshPoint(5,5, false));
//EikonalSolver solver = new EikonalSolverFMMAcuteTriangulation(targetPoints, new UnitTimeCostFunction(), uniformTriangulation);
/*MeshPanel panel = new MeshPanel(uniformTriangulation.getMesh(), 500, 500, new VRectangle(0, 0, width, height));
panel.display();
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}*/
EikonalSolver solver = new EikonalSolverFMMTriangulation(new UnitTimeCostFunction(), targetPoints, uniformTriangulation);
log.info("start FFM");
solver.initialize();
......
......@@ -2,7 +2,7 @@ package org.vadere.simulator.projects.dataprocessing.processor;
import org.junit.Before;
import org.junit.Test;
import org.vadere.tests.util.reflection.ReflectionHelper;
import org.vadere.simulator.utils.reflection.ReflectionHelper;
/**
......
......@@ -5,7 +5,7 @@ import org.junit.Test;
import org.vadere.simulator.control.SimulationState;
import org.vadere.simulator.projects.dataprocessing.ProcessorManager;
import org.vadere.simulator.projects.dataprocessing.outputfile.OutputFile;
import org.vadere.tests.util.reflection.ReflectionHelper;
import org.vadere.simulator.utils.reflection.ReflectionHelper;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
......
......@@ -7,7 +7,7 @@ import org.vadere.simulator.projects.dataprocessing.datakey.DataKey;
import org.vadere.simulator.projects.dataprocessing.outputfile.OutputFile;
import org.vadere.simulator.projects.dataprocessing.outputfile.OutputFileFactory;
import org.vadere.simulator.projects.dataprocessing.writer.VadereStringWriter;
import org.vadere.tests.util.reflection.ReflectionHelper;
import org.vadere.simulator.utils.reflection.ReflectionHelper;
import java.util.ArrayList;
import java.util.HashMap;
......
......@@ -7,7 +7,7 @@ import org.junit.Test;
import org.vadere.simulator.entrypoints.Version;
import org.vadere.simulator.projects.io.TestUtils;
import org.vadere.state.util.StateJsonConverter;
import org.vadere.tests.util.reflection.TestResourceHandler;
import org.vadere.simulator.utils.reflection.TestResourceHandler;
import org.vadere.util.io.IOUtils;
import java.io.IOException;
......
......@@ -2,9 +2,9 @@ package org.vadere.simulator.projects.migration.jolttranformation;
import org.junit.After;
import org.junit.Before;
import org.vadere.tests.util.reflection.TestJsonNodeExplorer;
import org.vadere.tests.util.reflection.TestJsonNodeHelper;
import org.vadere.tests.util.reflection.TestResourceHandler;
import org.vadere.simulator.utils.reflection.TestJsonNodeExplorer;
import org.vadere.simulator.utils.reflection.TestJsonNodeHelper;
import org.vadere.simulator.utils.reflection.TestResourceHandler;
abstract class JoltTransformationTest implements TestJsonNodeExplorer, TestJsonNodeHelper, TestResourceHandler {
......
......@@ -17,7 +17,7 @@ import org.vadere.state.scenario.Obstacle;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.scenario.Source;
import org.vadere.state.scenario.Topography;
import org.vadere.tests.util.reflection.TestResourceHandler;
import org.vadere.simulator.utils.reflection.TestResourceHandler;
import org.vadere.util.geometry.shapes.VCircle;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VShape;
......
package org.vadere.tests.util.reflection;
package org.vadere.simulator.utils.reflection;
import java.lang.reflect.Field;
......
package org.vadere.tests.util.reflection;
package org.vadere.simulator.utils.reflection;
import com.fasterxml.jackson.databind.JsonNode;
......@@ -11,7 +11,6 @@ import org.vadere.simulator.projects.migration.MigrationException;
import org.vadere.simulator.projects.migration.jolttranformation.JsonNodeExplorer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.StringJoiner;
import static org.hamcrest.CoreMatchers.not;
......
package org.vadere.tests.util.reflection;
package org.vadere.simulator.utils.reflection;
import com.fasterxml.jackson.databind.JsonNode;
......
package org.vadere.tests.util.reflection;
package org.vadere.simulator.utils.reflection;
import org.vadere.simulator.entrypoints.ScenarioFactory;
import org.vadere.simulator.projects.Scenario;
......
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