Funktionierende Version

This commit is contained in:
cmerkens 2024-07-08 22:30:55 +02:00
parent dd18dbd55e
commit 3c709ec120
8 changed files with 22 additions and 24 deletions

28
.idea/workspace.xml generated
View File

@ -5,25 +5,14 @@
</component>
<component name="ChangeListManager">
<list default="true" id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="Weighting gefixt">
<change afterPath="$PROJECT_DIR$/graph/VertexWeightMarking.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/OurApplication/OurAlgorithm.java" beforeDir="false" afterPath="$PROJECT_DIR$/OurApplication/OurAlgorithm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/OurApplication/OurApplication.java" beforeDir="false" afterPath="$PROJECT_DIR$/OurApplication/OurApplication.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/OurApplication/OurDrawArea.java" beforeDir="false" afterPath="$PROJECT_DIR$/OurApplication/OurDrawArea.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/OurApplication/OurParameterArea.java" beforeDir="false" afterPath="$PROJECT_DIR$/OurApplication/OurParameterArea.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/graph/DirectedGraph.java" beforeDir="false" afterPath="$PROJECT_DIR$/graph/DirectedGraph.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/graph/Graph.java" beforeDir="false" afterPath="$PROJECT_DIR$/graph/Graph.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/graph/UndirectedGraph.java" beforeDir="false" afterPath="$PROJECT_DIR$/graph/UndirectedGraph.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/graph/VertexMarking.java" beforeDir="false" afterPath="$PROJECT_DIR$/graph/VertexMarking.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurAlgorithm.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurAlgorithm.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurApplication.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurApplication.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurDrawArea.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurDrawArea.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/graph/DirectedGraph.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/graph/DirectedGraph.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/graph/ExampleGraphs.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/graph/ExampleGraphs.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/graph/Graph.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/graph/Graph.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/graph/UndirectedGraph.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/graph/UndirectedGraph.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/graph/VertexWeightMarking.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/graph/VertexWeightMarking.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurParameterArea.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurParameterArea.class" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -200,17 +189,22 @@
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/OurApplication/OurDrawArea.java</url>
<line>51</line>
<option name="timeStamp" value="5" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/OurApplication/OurAlgorithm.java</url>
<line>46</line>
<option name="timeStamp" value="6" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/OurApplication/OurParameterArea.java</url>
<line>142</line>
<option name="timeStamp" value="7" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
<watches-manager>
<configuration name="Application">
<watch expression="newGraph.screenGraph" />
</configuration>
</watches-manager>
</component>
</project>

View File

@ -73,7 +73,7 @@ public class OurAlgorithm extends Algorithm {
if(this.methodButtons.getSelectedMethod()){
// this.currentGraph.getShortestPathDijkstra(start, end);
this.currentGraph.getShortestPathDijkstra(start, end);
}else{
this.currentGraph.getShortestPathAStar(start, end);
}

View File

@ -42,6 +42,7 @@ public class OurDrawArea extends DrawArea{
public OurDrawArea(LogElementList<OurLogElement> logList, String drawAreaName){
super(logList, drawAreaName);
/*
this.addMouseListener(new MouseListener() {
MarkedVertex<VertexMarking> temp = null;
@ -87,9 +88,11 @@ public class OurDrawArea extends DrawArea{
public void mouseExited(MouseEvent e) {
}
});
*/
}
/*
public void setCurrentGraph(graph.Graph<VertexMarking, EdgeMarking> graph) {
this.currentGraph = graph;
}
@ -136,7 +139,7 @@ public class OurDrawArea extends DrawArea{
double distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
return distance <= radius;
}
*/
/**
* Draws a visualization element.

View File

@ -7,6 +7,7 @@ import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Objects;
/**
* This class provides an example for using visualization.ParameterArea.
@ -124,8 +125,8 @@ public class OurParameterArea extends ParameterArea{
}
// Vertex Eingabe: A-23-23;A-23-23
// Edge Eingabe: A-B-15;A-B-15
// Vertex Eingabe: A-100-100;B-200-200;C-100-200;D-200-100
// Edge Eingabe: A-B-15;C-D-10;D-A-3
public DirectedGraph<VertexMarking, EdgeMarking> createGraph(String vertices, String edges) {
DirectedGraph<VertexMarking, EdgeMarking> newGraph = new DirectedGraph<>();
@ -143,9 +144,9 @@ public class OurParameterArea extends ParameterArea{
for (String i: allEdges) {
String[] current = i.split("-");
for (MarkedVertex<VertexMarking> j: newGraph.getAllVertexes()) {
if (j.getName() == current[0]) {
if (Objects.equals(j.getName(), current[0])) {
start = j;
} else if (j.getName() == current[1]) {
} else if (Objects.equals(j.getName(), current[1])) {
end = j;
}
}