Added step to Algorithm to better display start and end vertex

This commit is contained in:
i23007 2024-07-05 14:00:35 +02:00
parent bed270e7d2
commit 04d5175ab0
3 changed files with 22 additions and 24 deletions

36
.idea/workspace.xml generated
View File

@ -4,19 +4,9 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="Adding AStar Algorithm"> <list default="true" id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="Stable Version with finished visualisation">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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/OurLogElement.java" beforeDir="false" afterPath="$PROJECT_DIR$/OurApplication/OurLogElement.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/DirectedGraph.java" beforeDir="false" afterPath="$PROJECT_DIR$/graph/DirectedGraph.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/graph/Display.java" beforeDir="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/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/OurApplication/OurLogElement.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurLogElement.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/Display.class" beforeDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -96,7 +86,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1720042374225</updated> <updated>1720042374225</updated>
</task> </task>
<option name="localTasksCounter" value="5" /> <task id="LOCAL-00005" summary="Stable Version with finished visualisation">
<option name="closed" value="true" />
<created>1720120737939</created>
<option name="number" value="00005" />
<option name="presentableId" value="LOCAL-00005" />
<option name="project" value="LOCAL" />
<updated>1720120737940</updated>
</task>
<option name="localTasksCounter" value="6" />
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">
@ -113,17 +111,7 @@
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="Stable Version 3.0" /> <MESSAGE value="Stable Version 3.0" />
<MESSAGE value="Adding AStar Algorithm" /> <MESSAGE value="Adding AStar Algorithm" />
<option name="LAST_COMMIT_MESSAGE" value="Adding AStar Algorithm" /> <MESSAGE value="Stable Version with finished visualisation" />
</component> <option name="LAST_COMMIT_MESSAGE" value="Stable Version with finished visualisation" />
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/OurApplication/OurDrawArea.java</url>
<line>53</line>
<option name="timeStamp" value="3" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component> </component>
</project> </project>

View File

@ -231,6 +231,11 @@ public class DirectedGraph<T extends VertexMarking, U extends EdgeMarking> exten
// Zähler für LogList // Zähler für LogList
int step = 0; int step = 0;
// Färben der Start und Ziel Knoten für Visualisierung + hinzufügen zur LogList
n1.getScreenVertex().setColor(Color.RED);
n2.getScreenVertex().setColor(Color.RED);
this.logList.add(new OurLogElement(step, "Step: " + step, 0, this.getScreenGraphCopy()));
while (!queue.isEmpty()) { while (!queue.isEmpty()) {
// Den nächsten Knoten, der am wenigsten kostet, besuchen // Den nächsten Knoten, der am wenigsten kostet, besuchen
WrapperElement<T> nextVertex = queue.poll(); WrapperElement<T> nextVertex = queue.poll();
@ -308,6 +313,11 @@ public class DirectedGraph<T extends VertexMarking, U extends EdgeMarking> exten
// Zähler für LogList // Zähler für LogList
int step = 0; int step = 0;
// Färben der Start und Ziel Knoten für Visualisierung + hinzufügen zur LogList
n1.getScreenVertex().setColor(Color.RED);
n2.getScreenVertex().setColor(Color.RED);
this.logList.add(new OurLogElement(step, "Step: " + step, 0, this.getScreenGraphCopy()));
while (!queue.isEmpty()) { while (!queue.isEmpty()) {
// Den nächsten Knoten, der am wenigsten kostet, besuchen // Den nächsten Knoten, der am wenigsten kostet, besuchen
WrapperElement<T> nextVertex = queue.poll(); WrapperElement<T> nextVertex = queue.poll();