Compare commits
35 Commits
Versuch_Ch
...
1313402f07
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1313402f07 | ||
|
|
ecf2bb8656 | ||
| b5730e1b18 | |||
| e020e34d94 | |||
|
|
1f67dde5c4 | ||
|
|
72181c9a39 | ||
|
|
5e4eec4e5c | ||
| f00057ee6e | |||
| 6060796ddd | |||
| e2c2038531 | |||
| c5d2060d37 | |||
| 3629584d14 | |||
| 3c74497254 | |||
| 245fa45606 | |||
| 4e6a9902bb | |||
| ebd1173cbc | |||
| cfcb6d4d40 | |||
| 79198f4f4a | |||
| 7180d7951a | |||
| b2c8b4f54f | |||
|
|
017bbe9307 | ||
|
|
42e9ca5ec8 | ||
| e07edf8b2b | |||
|
|
e19a031a16 | ||
| 04d5175ab0 | |||
| bed270e7d2 | |||
| 58ed89d78c | |||
|
|
26bd4bbb3a | ||
|
|
e76564e204 | ||
|
|
0904358705 | ||
| 6036220c6a | |||
| 213638ad16 | |||
| 12dbadf5e1 | |||
| 6b0caa1a5e | |||
| cf63dddf51 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
/out/
|
||||
/.idea/
|
||||
|
||||
132
.idea/workspace.xml
generated
132
.idea/workspace.xml
generated
@@ -4,14 +4,34 @@
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="Stable Version 3.0" />
|
||||
<list default="true" id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="LegendArea gestaltet">
|
||||
<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/OurLegendArea.java" beforeDir="false" afterPath="$PROJECT_DIR$/OurApplication/OurLegendArea.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/ExampleGraphs.java" beforeDir="false" afterPath="$PROJECT_DIR$/graph/ExampleGraphs.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/graph/UndirectedGraph.java" beforeDir="false" afterPath="$PROJECT_DIR$/graph/UndirectedGraph.java" 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" />
|
||||
<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/UndirectedGraph.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/graph/UndirectedGraph.class" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||
<map>
|
||||
<entry key="$PROJECT_DIR$" value="ebd1173cbc514ede7aa65ba6be90702c92e0e8b4" />
|
||||
</map>
|
||||
</option>
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
<option name="RESET_MODE" value="HARD" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"associatedIndex": 2
|
||||
@@ -22,16 +42,17 @@
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"Application.Display.executor": "Run",
|
||||
"Application.OurApplication.executor": "Run",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"git-widget-placeholder": "Versuch__Christian",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "C:/Git/ProjektGraphMain"
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"Application.Display.executor": "Run",
|
||||
"Application.OurApplication.executor": "Run",
|
||||
"Application.OurLegendArea.executor": "Run",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"git-widget-placeholder": "main",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "C:/Git/ProjektGraphMain"
|
||||
}
|
||||
}</component>
|
||||
}]]></component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="C:\Git\ProjektGraph" />
|
||||
@@ -58,7 +79,87 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720028543313</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="2" />
|
||||
<task id="LOCAL-00002" summary="Adding AStar Algorithm">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720036191925</created>
|
||||
<option name="number" value="00002" />
|
||||
<option name="presentableId" value="LOCAL-00002" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720036191926</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00003" summary="Adding AStar Algorithm">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720036227325</created>
|
||||
<option name="number" value="00003" />
|
||||
<option name="presentableId" value="LOCAL-00003" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720036227325</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00004" summary="Adding AStar Algorithm">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720042374225</created>
|
||||
<option name="number" value="00004" />
|
||||
<option name="presentableId" value="LOCAL-00004" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720042374225</updated>
|
||||
</task>
|
||||
<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>
|
||||
<task id="LOCAL-00006" summary="Stable Version 3.0">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720182049903</created>
|
||||
<option name="number" value="00006" />
|
||||
<option name="presentableId" value="LOCAL-00006" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720182049903</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00007" summary="Tests with marking of Edges and Vertexes Adding Visualisation of Edge weight and Vertex name fixed AStar">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720291413659</created>
|
||||
<option name="number" value="00007" />
|
||||
<option name="presentableId" value="LOCAL-00007" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720291413659</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00008" summary="small fix">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720293774580</created>
|
||||
<option name="number" value="00008" />
|
||||
<option name="presentableId" value="LOCAL-00008" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720293774580</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00009" summary="Beispiele überarbeitet">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720311867957</created>
|
||||
<option name="number" value="00009" />
|
||||
<option name="presentableId" value="LOCAL-00009" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720311867957</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00010" summary="LegendArea gestaltet">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720347450647</created>
|
||||
<option name="number" value="00010" />
|
||||
<option name="presentableId" value="LOCAL-00010" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720347450647</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00011" summary="Weighting gefixt">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720362585915</created>
|
||||
<option name="number" value="00011" />
|
||||
<option name="presentableId" value="LOCAL-00011" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720362585915</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="12" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
@@ -73,7 +174,14 @@
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="Adding AStar Algorithm" />
|
||||
<MESSAGE value="Stable Version with finished visualisation" />
|
||||
<MESSAGE value="Stable Version 3.0" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Stable Version 3.0" />
|
||||
<MESSAGE value="Tests with marking of Edges and Vertexes Adding Visualisation of Edge weight and Vertex name fixed AStar" />
|
||||
<MESSAGE value="small fix" />
|
||||
<MESSAGE value="Beispiele überarbeitet" />
|
||||
<MESSAGE value="LegendArea gestaltet" />
|
||||
<MESSAGE value="Weighting gefixt" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Weighting gefixt" />
|
||||
</component>
|
||||
</project>
|
||||
117
.idea/workspace.xml.BASE
generated
Normal file
117
.idea/workspace.xml.BASE
generated
Normal file
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="OurApplication test">
|
||||
<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/OurDrawArea.java" beforeDir="false" afterPath="$PROJECT_DIR$/OurApplication/OurDrawArea.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/MarkedVertex.java" beforeDir="false" afterPath="$PROJECT_DIR$/graph/MarkedVertex.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/graph/Vertex.java" beforeDir="false" afterPath="$PROJECT_DIR$/graph/Vertex.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="HTML File" />
|
||||
<option value="Class" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="Git.Merge.Settings">
|
||||
<option name="BRANCH" value="VisualisationTests" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||
<map>
|
||||
<entry key="$PROJECT_DIR$" value="main" />
|
||||
</map>
|
||||
</option>
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"associatedIndex": 2
|
||||
}</component>
|
||||
<component name="ProjectId" id="2hxt4apXjGaBR1xypJAsjIrgc8R" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"Application.OurApplication.executor": "Run",
|
||||
"DefaultHtmlFileTemplate": "HTML File",
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"git-widget-placeholder": "main",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "C:/Users/jonas/DHBW Dateien/Semester 2/Programmieren 2/Projekt/ProjektGraph/OurApplication",
|
||||
"settings.editor.selected.configurable": "vcs.Git"
|
||||
}
|
||||
}]]></component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="C:\Users\jonas\DHBW Dateien\Semester 2\Programmieren 2\Projekt\ProjektGraph\OurApplication" />
|
||||
</key>
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="C:\Users\jonas\DHBW Dateien\Semester 2\Programmieren 2\Projekt\ProjektGraph\visualizationElements" />
|
||||
<recent name="C:\Users\jonas\DHBW Dateien\Semester 2\Programmieren 2\Projekt\ProjektGraph\testApplication" />
|
||||
<recent name="C:\Users\jonas\DHBW Dateien\Semester 2\Programmieren 2\Projekt\ProjektGraph\logging" />
|
||||
<recent name="C:\Users\jonas\DHBW Dateien\Semester 2\Programmieren 2\Projekt\ProjektGraph\visualisation" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="" />
|
||||
<created>1718547365327</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1718547365327</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="Visualisation tests">
|
||||
<option name="closed" value="true" />
|
||||
<created>1719479266810</created>
|
||||
<option name="number" value="00001" />
|
||||
<option name="presentableId" value="LOCAL-00001" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1719479266810</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00002" summary="OurApplication test">
|
||||
<option name="closed" value="true" />
|
||||
<created>1719493522512</created>
|
||||
<option name="number" value="00002" />
|
||||
<option name="presentableId" value="LOCAL-00002" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1719493522512</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="3" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="Visualisation tests" />
|
||||
<MESSAGE value="OurApplication test" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="OurApplication test" />
|
||||
</component>
|
||||
</project>
|
||||
79
.idea/workspace.xml.LOCAL
generated
Normal file
79
.idea/workspace.xml.LOCAL
generated
Normal file
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="Stable Version 3.0" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"associatedIndex": 2
|
||||
}</component>
|
||||
<component name="ProjectId" id="2hxt4apXjGaBR1xypJAsjIrgc8R" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"Application.Display.executor": "Run",
|
||||
"Application.OurApplication.executor": "Run",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"git-widget-placeholder": "Versuch__Christian",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "C:/Git/ProjektGraphMain"
|
||||
}
|
||||
}</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="C:\Git\ProjektGraph" />
|
||||
</key>
|
||||
<key name="CopyClassDialog.RECENTS_KEY">
|
||||
<recent name="logging" />
|
||||
<recent name="visualisation" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="" />
|
||||
<created>1718547365327</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1718547365327</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="Stable Version 3.0">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720028543313</created>
|
||||
<option name="number" value="00001" />
|
||||
<option name="presentableId" value="LOCAL-00001" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720028543313</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="2" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="Stable Version 3.0" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Stable Version 3.0" />
|
||||
</component>
|
||||
</project>
|
||||
114
.idea/workspace.xml.REMOTE
generated
Normal file
114
.idea/workspace.xml.REMOTE
generated
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="OurApplication test">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/OurApplication/OurDrawArea.java" beforeDir="false" afterPath="$PROJECT_DIR$/OurApplication/OurDrawArea.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/graph/MarkedVertex.java" beforeDir="false" afterPath="$PROJECT_DIR$/graph/MarkedVertex.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/graph/Vertex.java" beforeDir="false" afterPath="$PROJECT_DIR$/graph/Vertex.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="HTML File" />
|
||||
<option value="Class" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="Git.Merge.Settings">
|
||||
<option name="BRANCH" value="VisualisationTests" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||
<map>
|
||||
<entry key="$PROJECT_DIR$" value="main" />
|
||||
</map>
|
||||
</option>
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"associatedIndex": 2
|
||||
}</component>
|
||||
<component name="ProjectId" id="2hxt4apXjGaBR1xypJAsjIrgc8R" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"Application.OurApplication.executor": "Run",
|
||||
"DefaultHtmlFileTemplate": "HTML File",
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"git-widget-placeholder": "main",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "C:/Users/jonas/DHBW Dateien/Semester 2/Programmieren 2/Projekt/ProjektGraph/OurApplication",
|
||||
"settings.editor.selected.configurable": "vcs.Git"
|
||||
}
|
||||
}</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="C:\Users\jonas\DHBW Dateien\Semester 2\Programmieren 2\Projekt\ProjektGraph\OurApplication" />
|
||||
</key>
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="C:\Users\jonas\DHBW Dateien\Semester 2\Programmieren 2\Projekt\ProjektGraph\visualizationElements" />
|
||||
<recent name="C:\Users\jonas\DHBW Dateien\Semester 2\Programmieren 2\Projekt\ProjektGraph\testApplication" />
|
||||
<recent name="C:\Users\jonas\DHBW Dateien\Semester 2\Programmieren 2\Projekt\ProjektGraph\logging" />
|
||||
<recent name="C:\Users\jonas\DHBW Dateien\Semester 2\Programmieren 2\Projekt\ProjektGraph\visualisation" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="" />
|
||||
<created>1718547365327</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1718547365327</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="Visualisation tests">
|
||||
<option name="closed" value="true" />
|
||||
<created>1719479266810</created>
|
||||
<option name="number" value="00001" />
|
||||
<option name="presentableId" value="LOCAL-00001" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1719479266810</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00002" summary="OurApplication test">
|
||||
<option name="closed" value="true" />
|
||||
<created>1719493522512</created>
|
||||
<option name="number" value="00002" />
|
||||
<option name="presentableId" value="LOCAL-00002" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1719493522512</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="3" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="Visualisation tests" />
|
||||
<MESSAGE value="OurApplication test" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="OurApplication test" />
|
||||
</component>
|
||||
</project>
|
||||
100
.idea/workspace.xml.bak
generated
Normal file
100
.idea/workspace.xml.bak
generated
Normal file
@@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<<<<<<< HEAD
|
||||
<list default="true" id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="Stable Version 3.0" />
|
||||
=======
|
||||
<list default="true" id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="OurApplication test">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/OurApplication/OurDrawArea.java" beforeDir="false" afterPath="$PROJECT_DIR$/OurApplication/OurDrawArea.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/graph/MarkedVertex.java" beforeDir="false" afterPath="$PROJECT_DIR$/graph/MarkedVertex.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/graph/Vertex.java" beforeDir="false" afterPath="$PROJECT_DIR$/graph/Vertex.java" afterDir="false" />
|
||||
</list>
|
||||
>>>>>>> 6036220c6ac166fb6e4e98d0cf9cdb5af020066a
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"associatedIndex": 2
|
||||
}</component>
|
||||
<component name="ProjectId" id="2hxt4apXjGaBR1xypJAsjIrgc8R" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
<<<<<<< HEAD
|
||||
"Application.Display.executor": "Run",
|
||||
"Application.OurApplication.executor": "Run",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"git-widget-placeholder": "Versuch__Christian",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "C:/Git/ProjektGraphMain"
|
||||
=======
|
||||
"Application.OurApplication.executor": "Run",
|
||||
"DefaultHtmlFileTemplate": "HTML File",
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"git-widget-placeholder": "main",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "C:/Users/jonas/DHBW Dateien/Semester 2/Programmieren 2/Projekt/ProjektGraph/OurApplication",
|
||||
"settings.editor.selected.configurable": "vcs.Git"
|
||||
>>>>>>> 6036220c6ac166fb6e4e98d0cf9cdb5af020066a
|
||||
}
|
||||
}</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="C:\Git\ProjektGraph" />
|
||||
</key>
|
||||
<key name="CopyClassDialog.RECENTS_KEY">
|
||||
<recent name="logging" />
|
||||
<recent name="visualisation" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="" />
|
||||
<created>1718547365327</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1718547365327</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="Stable Version 3.0">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720028543313</created>
|
||||
<option name="number" value="00001" />
|
||||
<option name="presentableId" value="LOCAL-00001" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720028543313</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="2" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="Stable Version 3.0" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Stable Version 3.0" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -6,6 +6,7 @@ import logging.LogElementList;
|
||||
import visualizationElements.Vertex;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.Objects;
|
||||
import java.util.Random;
|
||||
import java.util.Vector;
|
||||
|
||||
@@ -20,6 +21,7 @@ import java.util.Vector;
|
||||
public class OurAlgorithm extends Algorithm {
|
||||
|
||||
private graph.Graph<VertexMarking, EdgeMarking> currentGraph;
|
||||
private OurMethodButtons methodButtons;
|
||||
|
||||
public OurAlgorithm() {
|
||||
super();
|
||||
@@ -28,8 +30,9 @@ public class OurAlgorithm extends Algorithm {
|
||||
* Creates a sum up algorithm.
|
||||
* @param parameterArea the sum up parameter area the algorithm gets its parameters from
|
||||
*/
|
||||
public OurAlgorithm(OurParameterArea parameterArea){
|
||||
public OurAlgorithm(OurParameterArea parameterArea, OurMethodButtons methodButtons){
|
||||
super(parameterArea,"GraphAlgorithm");
|
||||
this.methodButtons = methodButtons;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -41,13 +44,37 @@ public class OurAlgorithm extends Algorithm {
|
||||
*/
|
||||
public LogElementList<OurLogElement> run() {
|
||||
|
||||
OurParameterArea currentParameterArea = (OurParameterArea) this.getParameterArea();
|
||||
this.setCurrentGraph(currentParameterArea.getSelectedGraph());
|
||||
|
||||
|
||||
MarkedVertex<VertexMarking> start = null;
|
||||
for (MarkedVertex<VertexMarking> i: this.currentGraph.getAllVertexes()) {
|
||||
if (Objects.equals(i.getName(), "Start")) {
|
||||
start = i;
|
||||
}
|
||||
}
|
||||
|
||||
MarkedVertex<VertexMarking> end = null;
|
||||
for (MarkedVertex<VertexMarking> i: this.currentGraph.getAllVertexes()) {
|
||||
if (Objects.equals(i.getName(), "Ende")) {
|
||||
end = i;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Random random = new Random();
|
||||
|
||||
MarkedVertex<VertexMarking> start = this.currentGraph.getAllVertexes().get(random.nextInt(this.currentGraph.getAllVertexes().size()));
|
||||
MarkedVertex<VertexMarking> end = this.currentGraph.getAllVertexes().get(random.nextInt(this.currentGraph.getAllVertexes().size()));
|
||||
System.out.println(start.getName() + " to " + end.getName());
|
||||
|
||||
this.currentGraph.getShortestPathDijkstra(start, end);
|
||||
*/
|
||||
if(this.methodButtons.getSelectedMethod()){
|
||||
this.currentGraph.getShortestPathDijkstra(start, end);
|
||||
}else{
|
||||
this.currentGraph.getShortestPathAStar(start, end);
|
||||
}
|
||||
|
||||
return this.currentGraph.getLogList();
|
||||
}
|
||||
|
||||
@@ -3,9 +3,11 @@ package OurApplication;
|
||||
import graph.*;
|
||||
import logging.LogElementList;
|
||||
import visualisation.HybridWindow;
|
||||
import visualizationElements.Vertex;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
@@ -40,13 +42,28 @@ public class OurApplication {
|
||||
*/
|
||||
public static void main(String[]args){
|
||||
|
||||
LogElementList<OurLogElement>logList = new LogElementList<OurLogElement>();
|
||||
Random random = new Random();
|
||||
|
||||
DirectedGraph<VertexMarking, EdgeMarking> myGraph = new DirectedGraph<>();
|
||||
|
||||
ExampleGraphs temp = new ExampleGraphs();
|
||||
myGraph = temp.example1();
|
||||
//sean: Ich wollte erst hier dann das ausgewählte Beispiel reinhauen, jedoch wird das hier nur einmal am Anfang aufgerufen
|
||||
System.out.println(myGraph.toString());
|
||||
|
||||
|
||||
|
||||
LogElementList<OurLogElement> logList=new LogElementList<OurLogElement>();
|
||||
OurParameterArea parameterArea = new OurParameterArea();
|
||||
OurMethodButtons methodButtons = new OurMethodButtons();
|
||||
OurDrawArea drawArea = new OurDrawArea(logList,"GraphVisualization");
|
||||
OurTextArea textArea = new OurTextArea(logList);
|
||||
OurAlgorithm algorithm = new OurAlgorithm(parameterArea);
|
||||
OurAlgorithm algorithm = new OurAlgorithm(parameterArea, methodButtons);
|
||||
OurLegendArea legendArea = new OurLegendArea();
|
||||
HybridWindow<OurDrawArea, OurTextArea, OurParameterArea, OurAlgorithm, OurLogElement, OurLegendArea> applet = new HybridWindow<OurDrawArea, OurTextArea, OurParameterArea, OurAlgorithm, OurLogElement, OurLegendArea>(drawArea, textArea, parameterArea, algorithm, logList, legendArea);
|
||||
OurHybridWindow<OurDrawArea, OurTextArea, OurParameterArea, OurAlgorithm, OurLogElement, OurLegendArea, OurMethodButtons> applet = new OurHybridWindow<OurDrawArea, OurTextArea, OurParameterArea, OurAlgorithm, OurLogElement, OurLegendArea, OurMethodButtons>(drawArea, textArea, parameterArea, algorithm, logList, legendArea, methodButtons);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
JFrame frame = new JFrame("Visualise");
|
||||
@@ -55,33 +72,9 @@ public class OurApplication {
|
||||
frame.pack();
|
||||
applet.init();
|
||||
applet.start();
|
||||
frame.setSize(800,600);
|
||||
frame.setSize(1000,800);
|
||||
frame.setVisible(true);
|
||||
|
||||
|
||||
Random random = new Random();
|
||||
|
||||
DirectedGraph<VertexMarking, EdgeMarking> myGraph = new DirectedGraph<>();
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
myGraph.addVertex(new MarkedVertex<>(random.nextInt(1, 10)*40, random.nextInt(1, 10)*40, Integer.toString(i), null, Color.BLACK));
|
||||
}
|
||||
|
||||
for (MarkedVertex<VertexMarking> i: myGraph.getAllVertexes()) {
|
||||
myGraph.addEdge(new MarkedEdge<>("a", i, myGraph.getAllVertexes().get(random.nextInt(myGraph.getAllVertexes().size())), null, random.nextInt(1, 10)));
|
||||
}
|
||||
/*
|
||||
for (MarkedVertex<VertexMarking> i: myGraph.getAllVertexes()) {
|
||||
myGraph.addEdge(new MarkedEdge<>("a", i, myGraph.getAllVertexes().get(random.nextInt(myGraph.getAllVertexes().size())), null, random.nextInt(1, 10)));
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
System.out.println(myGraph.toString());
|
||||
|
||||
drawArea.setCurrentGraph(myGraph);
|
||||
algorithm.setCurrentGraph(myGraph);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
package OurApplication;
|
||||
|
||||
import graph.*;
|
||||
import graph.Graph;
|
||||
import logging.LogElementList;
|
||||
import visualisation.DrawArea;
|
||||
import visualizationElements.*;
|
||||
import visualizationElements.Edge;
|
||||
import visualizationElements.Vertex;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.Random;
|
||||
import java.util.Vector;
|
||||
|
||||
/**
|
||||
* This class provides an example for using visualization.DrawArea.
|
||||
@@ -21,7 +22,7 @@ public class OurDrawArea extends DrawArea{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private graph.Graph<VertexMarking, EdgeMarking> currentGraph;
|
||||
private visualizationElements.Graph currentGraph;
|
||||
|
||||
|
||||
/**
|
||||
@@ -41,7 +42,7 @@ public class OurDrawArea extends DrawArea{
|
||||
}
|
||||
|
||||
|
||||
public void setCurrentGraph(Graph<VertexMarking, EdgeMarking> graph) {
|
||||
public void setCurrentGraph(visualizationElements.Graph graph) {
|
||||
this.currentGraph = graph;
|
||||
}
|
||||
|
||||
@@ -51,26 +52,13 @@ public class OurDrawArea extends DrawArea{
|
||||
|
||||
public void draw(Graphics g) {
|
||||
|
||||
this.currentGraph.getScreenGraph().draw(g);
|
||||
|
||||
OurLogElement logElement = (OurLogElement) logList.get();
|
||||
|
||||
if (logElement.getVertex() != null) {
|
||||
if (logElement.getVertex().getColor() == Color.BLACK) {
|
||||
logElement.getVertex().setColor(Color.YELLOW);
|
||||
} else if (logElement.getVertex().getColor() == Color.YELLOW) {
|
||||
logElement.getVertex().setColor(Color.BLUE);
|
||||
}
|
||||
} else {
|
||||
if (logElement.getEdge().getColor() == Color.BLACK) {
|
||||
logElement.getEdge().setColor(Color.YELLOW);
|
||||
} else if (logElement.getEdge().getColor() == Color.YELLOW) {
|
||||
logElement.getEdge().setColor(Color.BLUE);
|
||||
}
|
||||
this.setCurrentGraph(((OurLogElement) logList.get()).getGraph());
|
||||
logElement.getGraph().draw(g);
|
||||
for(Edge screenEdge : currentGraph.getEdges()){
|
||||
g.drawString(screenEdge.getMarking(), (screenEdge.getSource().getXpos() + screenEdge.getDestination().getXpos())/2, (screenEdge.getSource().getYpos() + screenEdge.getDestination().getYpos())/2);
|
||||
}
|
||||
|
||||
logElement.getVertex().draw(g);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,19 @@
|
||||
package OurApplication;
|
||||
|
||||
import logging.Algorithm;
|
||||
import logging.LogElement;
|
||||
import logging.LogElementList;
|
||||
import visualisation.HybridWindow;
|
||||
import visualisation.*;
|
||||
import visualisation.TextArea;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.ItemEvent;
|
||||
import java.awt.event.ItemListener;
|
||||
|
||||
/**
|
||||
* This class provides an example for using visualization.HybridWindow.
|
||||
@@ -13,7 +25,36 @@ import visualisation.HybridWindow;
|
||||
* DHBW Stuttgart/Campus Horb AI2008<br>
|
||||
* <br>
|
||||
*/
|
||||
public class OurHybridWindow extends HybridWindow{
|
||||
public class OurHybridWindow<DRAW extends DrawArea,
|
||||
TEXT extends TextArea,
|
||||
PARAM extends ParameterArea,
|
||||
ALGORITHM extends Algorithm,
|
||||
LOG extends LogElement,
|
||||
LEGEND extends LegendArea,
|
||||
METHODBUTTONS extends ParameterArea> extends HybridWindow{
|
||||
|
||||
protected METHODBUTTONS methodButtons;
|
||||
protected StartListener startListener;
|
||||
/** Action listener for stop button. */
|
||||
protected StopListener stopListener;
|
||||
/** Action listener for previous button. */
|
||||
protected PrevListener prevListener;
|
||||
/** Action listener for next button. */
|
||||
protected NextListener nextListener;
|
||||
/** Action listener for first button. */
|
||||
protected FirstListener firstListener;
|
||||
/** Action listener for last button. */
|
||||
protected LastListener lastListener;
|
||||
/** Item listener for auto button. */
|
||||
protected AutoButtonListener autoButtonListener;
|
||||
/** Change listener for auto slider. */
|
||||
protected AutoSliderListener autoSliderListener;
|
||||
/** Item listener for forward button. */
|
||||
protected AutoForwardListener autoForwardListener;
|
||||
/** Item listener for backward button. */
|
||||
protected AutoBackwardListener autoBackwardListener;
|
||||
/** Item listener for pause button. */
|
||||
protected PauseButtonListener pauseButtonListener;
|
||||
|
||||
/**
|
||||
* Overwritten standard constructor.
|
||||
@@ -23,11 +64,245 @@ public class OurHybridWindow extends HybridWindow{
|
||||
*/
|
||||
public OurHybridWindow() {
|
||||
super();
|
||||
logList = new LogElementList<OurLogElement>();
|
||||
parameterArea = new OurParameterArea();
|
||||
drawArea = new OurDrawArea(logList,"visualization");
|
||||
textArea = new OurTextArea(logList);
|
||||
legendArea = new OurLegendArea();
|
||||
algorithm = new OurAlgorithm((OurParameterArea) parameterArea);
|
||||
}
|
||||
public OurHybridWindow(DRAW drawArea, TEXT textArea, PARAM parameterArea, ALGORITHM algorithm, LogElementList<LOG>logList, LEGEND legendArea, METHODBUTTONS methodButtons) {
|
||||
super(drawArea, textArea, parameterArea, algorithm, logList, legendArea);
|
||||
this.methodButtons = methodButtons;
|
||||
}
|
||||
public void init(){
|
||||
startButton=new JButton("start");
|
||||
stopButton=new JButton("stop");
|
||||
nextButton=new JButton("next");
|
||||
prevButton=new JButton("prev");
|
||||
lastButton=new JButton("last");
|
||||
firstButton=new JButton("first");
|
||||
autoButton=new JToggleButton("automatc");
|
||||
autoSlider=new JSlider(1,100,1);
|
||||
autoForwardButton=new JRadioButton("forward");
|
||||
autoBackwardButton=new JRadioButton("backward");
|
||||
pauseButton=new JButton("pause");
|
||||
|
||||
ButtonGroup autoDirection=new ButtonGroup();
|
||||
autoDirection.add(autoForwardButton);
|
||||
autoDirection.add(autoBackwardButton);
|
||||
autoForwardButton.setSelected(true);
|
||||
|
||||
JPanel panelStartStopControls=new JPanel();
|
||||
panelStartStopControls.setLayout(new GridLayout(4,1,5,5));
|
||||
panelStartStopControls.add(startButton);
|
||||
panelStartStopControls.add(stopButton);
|
||||
panelStartStopControls.add(pauseButton);
|
||||
panelStartStopControls.add(methodButtons);
|
||||
panelStartStopControls.setBorder(BorderFactory.createTitledBorder("Start / Stop"));
|
||||
|
||||
JPanel panelStepwiseExecutionControls=new JPanel();
|
||||
panelStepwiseExecutionControls.setLayout(new GridLayout(4,1,5,5));
|
||||
panelStepwiseExecutionControls.add(firstButton);
|
||||
panelStepwiseExecutionControls.add(nextButton);
|
||||
panelStepwiseExecutionControls.add(prevButton);
|
||||
panelStepwiseExecutionControls.add(lastButton);
|
||||
panelStepwiseExecutionControls.setBorder(BorderFactory.createTitledBorder("Stepwise execution"));
|
||||
|
||||
JPanel panelAutomaticExecutionControls=new JPanel();
|
||||
panelAutomaticExecutionControls.setLayout(new GridLayout(5,1,5,5));
|
||||
panelAutomaticExecutionControls.add(autoButton);
|
||||
panelAutomaticExecutionControls.add(autoSlider);
|
||||
panelAutomaticExecutionControls.add(autoForwardButton);
|
||||
panelAutomaticExecutionControls.add(autoBackwardButton);
|
||||
panelAutomaticExecutionControls.setBorder(BorderFactory.createTitledBorder("Automatic execution"));
|
||||
|
||||
JPanel buttonLine=new JPanel();
|
||||
buttonLine.setLayout(new GridLayout(3,1,5,5));
|
||||
buttonLine.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
|
||||
buttonLine.add(panelStartStopControls);
|
||||
buttonLine.add(panelStepwiseExecutionControls);
|
||||
buttonLine.add(panelAutomaticExecutionControls);
|
||||
|
||||
JLabel headline=new JLabel(algorithm.getTitle());
|
||||
headline.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
|
||||
headline.setFont(new Font("SansSerif",Font.PLAIN,20));
|
||||
|
||||
JScrollPane parameterAreaScrollPane = parameterArea.getScrollPane();
|
||||
JScrollPane legendAreaScrollPane = legendArea.getScrollPane();
|
||||
|
||||
parameterAreaScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
legendAreaScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
|
||||
JSplitPane hybridWindowSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,parameterAreaScrollPane, legendAreaScrollPane);
|
||||
hybridWindowSplitPane.setOneTouchExpandable(true);
|
||||
hybridWindowSplitPane.setResizeWeight(0.465);
|
||||
tabbedPane.insertTab(drawArea.getDrawAreaName(),null, drawArea.getScrollPane(),drawArea.getDrawAreaName(),0);
|
||||
tabbedPane.setSelectedIndex(0);
|
||||
|
||||
setLayout(new BorderLayout(10,10));
|
||||
|
||||
add(headline,BorderLayout.NORTH);
|
||||
add(hybridWindowSplitPane,BorderLayout.WEST);
|
||||
add(tabbedPane,BorderLayout.CENTER);
|
||||
add(textArea.getScrollPane(),BorderLayout.SOUTH);
|
||||
add(buttonLine,BorderLayout.EAST);
|
||||
|
||||
setState(PARAMETERSTATE);
|
||||
|
||||
startListener= new StartListener();
|
||||
stopListener=new StopListener();
|
||||
prevListener=new PrevListener();
|
||||
nextListener=new NextListener();
|
||||
firstListener=new FirstListener();
|
||||
lastListener=new LastListener();
|
||||
autoButtonListener=new AutoButtonListener();
|
||||
autoSliderListener=new AutoSliderListener();
|
||||
autoForwardListener=new AutoForwardListener();
|
||||
autoBackwardListener=new AutoBackwardListener();
|
||||
pauseButtonListener=new PauseButtonListener();
|
||||
|
||||
startButton.addActionListener(startListener);
|
||||
stopButton.addActionListener(stopListener);
|
||||
prevButton.addActionListener(prevListener);
|
||||
nextButton.addActionListener(nextListener);
|
||||
firstButton.addActionListener(firstListener);
|
||||
lastButton.addActionListener(lastListener);
|
||||
autoButton.addItemListener(autoButtonListener);
|
||||
autoSlider.addChangeListener(autoSliderListener);
|
||||
autoForwardButton.addItemListener(autoForwardListener);
|
||||
autoBackwardButton.addItemListener(autoBackwardListener);
|
||||
pauseButton.addActionListener(pauseButtonListener);
|
||||
|
||||
autoTimer=new Timer(1,nextListener);
|
||||
}
|
||||
|
||||
class StartListener implements ActionListener{
|
||||
public void actionPerformed(ActionEvent event){
|
||||
Component[]bComponents=methodButtons.getComponents();
|
||||
setState(RUNSTATE);
|
||||
for(Component c:bComponents){
|
||||
c.setEnabled(false);
|
||||
}
|
||||
logList=algorithm.run();
|
||||
drawArea.setLogList(logList);
|
||||
textArea.setLogList(logList);
|
||||
}
|
||||
}
|
||||
|
||||
class StopListener implements ActionListener{
|
||||
public void actionPerformed(ActionEvent event){
|
||||
Component[]bComponents=methodButtons.getComponents();
|
||||
setState(PARAMETERSTATE);
|
||||
for(Component c:bComponents){
|
||||
c.setEnabled(true);
|
||||
}
|
||||
logList.clear();
|
||||
drawArea.clear();
|
||||
textArea.clear();
|
||||
}
|
||||
}
|
||||
|
||||
class PrevListener implements ActionListener{
|
||||
public void actionPerformed(ActionEvent event){
|
||||
if(logList.isInitialized()){
|
||||
if(logList.get()==logList.firstElement()){
|
||||
autoButton.setSelected(false);
|
||||
}
|
||||
else{
|
||||
logList.prev();
|
||||
drawArea.drawStep();
|
||||
textArea.printStep();
|
||||
}
|
||||
}
|
||||
else{
|
||||
logList.prev();
|
||||
drawArea.drawStep();
|
||||
textArea.printStep();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class NextListener implements ActionListener{
|
||||
public void actionPerformed(ActionEvent event){
|
||||
if(logList.isInitialized()){
|
||||
if(logList.get()==logList.lastElement()){
|
||||
autoButton.setSelected(false);
|
||||
}
|
||||
else{
|
||||
logList.next();
|
||||
drawArea.drawStep();
|
||||
textArea.printStep();
|
||||
}
|
||||
}
|
||||
else{
|
||||
logList.next();
|
||||
drawArea.drawStep();
|
||||
textArea.printStep();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class FirstListener implements ActionListener{
|
||||
public void actionPerformed(ActionEvent event){
|
||||
logList.first();
|
||||
drawArea.drawStep();
|
||||
textArea.printStep();
|
||||
}
|
||||
}
|
||||
|
||||
class LastListener implements ActionListener{
|
||||
public void actionPerformed(ActionEvent event){
|
||||
logList.last();
|
||||
drawArea.drawStep();
|
||||
textArea.printStep();
|
||||
}
|
||||
}
|
||||
|
||||
class AutoButtonListener implements ItemListener {
|
||||
public void itemStateChanged(ItemEvent event){
|
||||
if(event.getStateChange()==ItemEvent.SELECTED){
|
||||
setState(AUTOSTATE);
|
||||
autoTimer.setDelay(10000/((int)Math.pow(autoSlider.getValue(),2)));
|
||||
autoTimer.start();
|
||||
}else{
|
||||
setState(RUNSTATE);
|
||||
autoTimer.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class AutoSliderListener implements ChangeListener {
|
||||
public void stateChanged(ChangeEvent event){
|
||||
if(autoTimer.isRunning()){
|
||||
autoTimer.stop();
|
||||
autoTimer.setInitialDelay(10000/((int)Math.pow(autoSlider.getValue(),2)));
|
||||
autoTimer.setDelay(10000/((int)Math.pow(autoSlider.getValue(),2)));
|
||||
autoTimer.start();
|
||||
autoTimer.setInitialDelay(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class AutoForwardListener implements ItemListener{
|
||||
public void itemStateChanged(ItemEvent event){
|
||||
if(event.getStateChange()==ItemEvent.SELECTED){
|
||||
autoTimer.removeActionListener(prevListener);
|
||||
autoTimer.addActionListener(nextListener);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class AutoBackwardListener implements ItemListener{
|
||||
public void itemStateChanged(ItemEvent event){
|
||||
if(event.getStateChange()==ItemEvent.SELECTED){
|
||||
autoTimer.removeActionListener(nextListener);
|
||||
autoTimer.addActionListener(prevListener);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class PauseButtonListener implements ActionListener{
|
||||
public void actionPerformed(ActionEvent event){
|
||||
if(autoButton.isSelected()){
|
||||
setState(RUNSTATE);
|
||||
autoTimer.stop();
|
||||
autoButton.setSelected(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,9 +31,47 @@ public class OurLegendArea extends LegendArea{
|
||||
* Draws all elements and descriptions on the LegendArea
|
||||
* @param g the Graphics object of the corresponding panel
|
||||
*/
|
||||
public void initialize(Graphics g){
|
||||
|
||||
//Create a new TitledBorder for the LegendArea
|
||||
setBorder(BorderFactory.createTitledBorder("LegendArea"));
|
||||
public void initialize(Graphics g) {
|
||||
|
||||
// Erstellt einen neuen TitledBorder für den Legendenbereich
|
||||
setBorder(BorderFactory.createTitledBorder("LegendArea"));
|
||||
|
||||
// Zeichnet den roten Knoten (Start/End Knoten)
|
||||
int y = 30; // Startposition für das Zeichnen der Legenden-Elemente
|
||||
g.setColor(Color.RED);
|
||||
g.fillOval(10, y, 20, 20); // Zeichnet einen kleinen Kreis (Knoten) mit der Farbe des Elements
|
||||
g.setColor(Color.BLACK);
|
||||
g.drawOval(10, y, 20, 20); // Zeichnet den Rand des Kreises
|
||||
g.drawString("Start/End Knoten", 40, y + 15); // Zeichnet die Beschreibung neben dem Kreis
|
||||
|
||||
// Zeichnet den blauen Knoten (Besuchter Knoten)
|
||||
y += 40; // Nach unten verschieben für das nächste Element
|
||||
g.setColor(Color.BLUE);
|
||||
g.fillOval(10, y, 20, 20); // Zeichnet einen kleinen Kreis (Knoten) mit der Farbe des Elements
|
||||
g.setColor(Color.BLACK);
|
||||
g.drawOval(10, y, 20, 20); // Zeichnet den Rand des Kreises
|
||||
g.drawString("Besuchter Knoten", 40, y + 15); // Zeichnet die Beschreibung neben dem Kreis
|
||||
|
||||
// Zeichnet den gelben Knoten (Erreichbare Knoten)
|
||||
y += 40; // Nach unten verschieben für das nächste Element
|
||||
g.setColor(Color.YELLOW);
|
||||
g.fillOval(10, y, 20, 20); // Zeichnet einen kleinen Kreis (Knoten) mit der Farbe des Elements
|
||||
g.setColor(Color.BLACK);
|
||||
g.drawOval(10, y, 20, 20); // Zeichnet den Rand des Kreises
|
||||
g.drawString("Erreichbare Knoten", 40, y + 15); // Zeichnet die Beschreibung neben dem Kreis
|
||||
|
||||
// Zeichnet den grünen Knoten (Fertiger Weg)
|
||||
y += 40; // Nach unten verschieben für das nächste Element
|
||||
g.setColor(Color.green);
|
||||
g.fillOval(10, y, 20, 20); // Zeichnet einen kleinen Kreis (Knoten) mit der Farbe des Elements
|
||||
g.setColor(Color.BLACK);
|
||||
g.drawOval(10, y, 20, 20); // Zeichnet den Rand des Kreises
|
||||
g.drawString("Fertiger Weg", 40, y + 15); // Zeichnet die Beschreibung neben dem Kreis
|
||||
|
||||
// Zeichnet die schwarze Linie (Kanten Markierung)
|
||||
y += 40; // Nach unten verschieben für das nächste Element
|
||||
g.setColor(Color.BLACK);
|
||||
g.drawLine(10, y + 10, 30, y + 10); // Zeichnet eine horizontale Linie
|
||||
g.drawString("Kanten Markierung", 40, y + 15); // Zeichnet die Beschreibung neben der Linie
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ public class OurLogElement extends LogElement{
|
||||
protected long value;
|
||||
protected Vertex vertex;
|
||||
protected Edge edge;
|
||||
protected visualizationElements.Graph ourGraph;
|
||||
|
||||
/**
|
||||
* Standard constructor.
|
||||
@@ -39,19 +40,27 @@ public class OurLogElement extends LogElement{
|
||||
* @param description the log element's step description
|
||||
* @param value the log element's sum up value
|
||||
*/
|
||||
public OurLogElement(int step, String description, long value, Vertex v){
|
||||
public OurLogElement(int step, String description, long value, Vertex vertex){
|
||||
this.step = step;
|
||||
this.description = description;
|
||||
this.value = value;
|
||||
this.vertex = v;
|
||||
this.vertex = vertex;
|
||||
}
|
||||
|
||||
|
||||
public OurLogElement(int step, String description, long value, Edge e){
|
||||
public OurLogElement(int step, String description, long value, Edge edge){
|
||||
this.step = step;
|
||||
this.description = description;
|
||||
this.value = value;
|
||||
this.edge = e;
|
||||
this.edge = edge;
|
||||
}
|
||||
|
||||
|
||||
public OurLogElement(int step, String description, long value, visualizationElements.Graph ourGraph ){
|
||||
this.step = step;
|
||||
this.description = description;
|
||||
this.value = value;
|
||||
this.ourGraph = ourGraph;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,4 +80,9 @@ public class OurLogElement extends LogElement{
|
||||
public Vertex getVertex() {
|
||||
return this.vertex;
|
||||
}
|
||||
|
||||
|
||||
public visualizationElements.Graph getGraph() {
|
||||
return this.ourGraph;
|
||||
}
|
||||
}
|
||||
|
||||
73
OurApplication/OurMethodButtons.java
Normal file
73
OurApplication/OurMethodButtons.java
Normal file
@@ -0,0 +1,73 @@
|
||||
package OurApplication;
|
||||
|
||||
import visualisation.ParameterArea;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
/**
|
||||
* This class provides an example for using visualization.ParameterArea.
|
||||
* @see ParameterArea
|
||||
* @author MSch<63>fer
|
||||
* DHBW Stuttgart/Campus Horb AI2008<br>
|
||||
* <br>
|
||||
*/
|
||||
public class OurMethodButtons extends ParameterArea{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected JRadioButton button1;
|
||||
protected JRadioButton button2;
|
||||
private boolean isDjikstra;
|
||||
|
||||
|
||||
/** TextField containing maximum sum up value. */
|
||||
protected JTextField maxValue;
|
||||
|
||||
/**
|
||||
* Standard constructor.
|
||||
* Creates SumUpMethodArea with an empty JTextField.
|
||||
*/
|
||||
public OurMethodButtons() {
|
||||
super();
|
||||
|
||||
isDjikstra = true; // Standardmäßig Djikstra
|
||||
|
||||
// Layout-Manager setzen, um die Buttons vertikal anzuordnen
|
||||
setLayout(new GridLayout(1, 2, 5, 5)); // 1 Zeile, 2 Spalten, 5 Pixel Abstand
|
||||
|
||||
// Buttons erstellen
|
||||
button1 = new JRadioButton("Djikstra", true);
|
||||
button2 = new JRadioButton("A-Stern");
|
||||
|
||||
// ButtonGroup erstellen und Buttons hinzufügen, um die gegenseitige Ausschließung zu gewährleisten
|
||||
ButtonGroup group = new ButtonGroup();
|
||||
group.add(button1);
|
||||
group.add(button2);
|
||||
|
||||
// ActionListener hinzufügen
|
||||
button1.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
isDjikstra = true;
|
||||
}
|
||||
});
|
||||
|
||||
button2.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
isDjikstra = false;
|
||||
}
|
||||
});
|
||||
|
||||
// Buttons zum Panel hinzufügen
|
||||
this.add(button1);
|
||||
this.add(button2);
|
||||
}
|
||||
|
||||
public boolean getSelectedMethod() {
|
||||
return isDjikstra;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,15 @@
|
||||
package OurApplication;
|
||||
|
||||
import graph.DirectedGraph;
|
||||
import graph.EdgeMarking;
|
||||
import graph.ExampleGraphs;
|
||||
import graph.VertexMarking;
|
||||
import visualisation.ParameterArea;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
/**
|
||||
* This class provides an example for using visualization.ParameterArea.
|
||||
@@ -14,7 +21,17 @@ import javax.swing.*;
|
||||
public class OurParameterArea extends ParameterArea{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
private JRadioButton button1;
|
||||
private JRadioButton button2;
|
||||
private JRadioButton button3;
|
||||
private JRadioButton button4;
|
||||
private JRadioButton button5;
|
||||
|
||||
private ExampleGraphs temp;
|
||||
private int selectedExample;
|
||||
|
||||
|
||||
/** TextField containing maximum sum up value. */
|
||||
protected JTextField maxValue;
|
||||
|
||||
@@ -24,8 +41,89 @@ public class OurParameterArea extends ParameterArea{
|
||||
*/
|
||||
public OurParameterArea() {
|
||||
super();
|
||||
temp = new ExampleGraphs();
|
||||
selectedExample = 1; // Standardmäßig Beispiel 1
|
||||
|
||||
setBorder(BorderFactory.createTitledBorder("ParameterArea"));
|
||||
|
||||
// Hier Elemente adden
|
||||
// Layout-Manager setzen, um die Buttons vertikal anzuordnen
|
||||
setLayout(new GridLayout(4, 1, 5, 5)); // 4 Zeilen, 1 Spalte, 5 Pixel Abstand
|
||||
|
||||
// Buttons erstellen
|
||||
button1 = new JRadioButton("Beispiel 1", true);
|
||||
button2 = new JRadioButton("Beispiel 2");
|
||||
button3 = new JRadioButton("Beispiel 3");
|
||||
button4 = new JRadioButton("Beispiel 4");
|
||||
button5 = new JRadioButton("Eigener Graph");
|
||||
|
||||
|
||||
// ButtonGroup erstellen und Buttons hinzufügen, um die gegenseitige Ausschließung zu gewährleisten
|
||||
ButtonGroup group = new ButtonGroup();
|
||||
group.add(button1);
|
||||
group.add(button2);
|
||||
group.add(button3);
|
||||
group.add(button4);
|
||||
group.add(button5);
|
||||
|
||||
// ActionListener hinzufügen
|
||||
button1.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
selectedExample = 1;
|
||||
}
|
||||
});
|
||||
|
||||
button2.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
selectedExample = 2;
|
||||
}
|
||||
});
|
||||
|
||||
button3.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
selectedExample = 3;
|
||||
}
|
||||
});
|
||||
|
||||
button4.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
selectedExample = 4;
|
||||
}
|
||||
});
|
||||
|
||||
button5.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
selectedExample = 5;
|
||||
}
|
||||
});
|
||||
|
||||
// Buttons zum Panel hinzufügen
|
||||
add(button1);
|
||||
add(button2);
|
||||
add(button3);
|
||||
add(button4);
|
||||
add(button5);
|
||||
}
|
||||
|
||||
public DirectedGraph<VertexMarking, EdgeMarking> getSelectedGraph() {
|
||||
ExampleGraphs temp = new ExampleGraphs();
|
||||
switch (selectedExample) {
|
||||
case 2:
|
||||
return temp.example2();
|
||||
case 3:
|
||||
return temp.example3();
|
||||
case 4:
|
||||
return temp.example4();
|
||||
case 5:
|
||||
return new DirectedGraph<>();
|
||||
case 1:
|
||||
default:
|
||||
return temp.example1();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package OurApplication;
|
||||
|
||||
import logging.LogElement;
|
||||
import logging.LogElementList;
|
||||
import visualisation.TextArea;
|
||||
|
||||
@@ -36,6 +37,8 @@ public class OurTextArea extends TextArea{
|
||||
* No output.
|
||||
*/
|
||||
public boolean print(){
|
||||
LogElement logElement=(LogElement)logList.get();
|
||||
setText(logElement.getDescription());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package graph;
|
||||
|
||||
import OurApplication.OurAlgorithm;
|
||||
import OurApplication.OurLogElement;
|
||||
import logging.LogElementList;
|
||||
import visualizationElements.Edge;
|
||||
import visualizationElements.EdgeStyle;
|
||||
import visualizationElements.Vertex;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
import java.util.PriorityQueue;
|
||||
@@ -43,6 +42,23 @@ public class DirectedGraph<T extends VertexMarking, U extends EdgeMarking> exten
|
||||
return this.screenGraph;
|
||||
}
|
||||
|
||||
public visualizationElements.Graph getScreenGraphCopy() {
|
||||
visualizationElements.Graph graphCopy = new visualizationElements.Graph(new Vector<Vertex>(), new Vector<Edge>(), true, EdgeStyle.Direct);
|
||||
Vector<visualizationElements.Vertex> copiedVertexes = new Vector<>();
|
||||
Vector<visualizationElements.Edge> copiedEdges = new Vector<>();
|
||||
for (visualizationElements.Vertex vertexCopy : this.screenGraph.getVertexes()) {
|
||||
visualizationElements.Vertex newCopiedVertex = new visualizationElements.Vertex(vertexCopy.getXpos(), vertexCopy.getYpos(), vertexCopy.getMarking(), vertexCopy.getColor());
|
||||
copiedVertexes.add(newCopiedVertex);
|
||||
graphCopy.setVertexes(copiedVertexes);
|
||||
}
|
||||
for (visualizationElements.Edge edgeCopy : this.screenGraph.getEdges()) {
|
||||
visualizationElements.Edge newCopiedEdge = new visualizationElements.Edge(edgeCopy.getSource(), edgeCopy.getDestination(), edgeCopy.getMarking(), edgeCopy.getColor());
|
||||
copiedEdges.add(newCopiedEdge);
|
||||
graphCopy.setEdges(copiedEdges);
|
||||
}
|
||||
return graphCopy;
|
||||
}
|
||||
|
||||
|
||||
public LogElementList<OurLogElement> getLogList() {
|
||||
return this.logList;
|
||||
@@ -191,13 +207,17 @@ public class DirectedGraph<T extends VertexMarking, U extends EdgeMarking> exten
|
||||
|
||||
// Erstellt Hashmap um Distanz von Startnoten zu jedem Knoten auf dem Graph zu tracken
|
||||
// Erstellt Hashmap um zu tracken welche Knoten schon besucht wurden
|
||||
// Erstelle Hashmap um Vorgängerknoten zu tracken
|
||||
// Initialisierung aller Distanzen auf UNENDLICH (= -1)
|
||||
// Initialisierung, dass kein Knoten besucht wurde
|
||||
// Initialisierung aller Vorgänger auf null
|
||||
HashMap<MarkedVertex<T>, Integer> distance = new HashMap<>();
|
||||
HashMap<MarkedVertex<T>, Boolean> visited = new HashMap<>();
|
||||
HashMap<MarkedVertex<T>, MarkedVertex<T>> predecessors = new HashMap<>();
|
||||
for (MarkedVertex<T> i: this.getAllVertexes()) {
|
||||
distance.put(i, -1);
|
||||
visited.put(i, false);
|
||||
predecessors.put(i, null);
|
||||
}
|
||||
|
||||
// Erstelle Schlange wo die nächsten Verbindungen drin sind
|
||||
@@ -212,7 +232,16 @@ public class DirectedGraph<T extends VertexMarking, U extends EdgeMarking> exten
|
||||
int dist = 0;
|
||||
// Zähler für LogList
|
||||
int step = 0;
|
||||
visualizationElements.Graph display;
|
||||
// String für den Description Inhalt
|
||||
String textDescription;
|
||||
|
||||
// Färben der Start und Ziel Knoten für Visualisierung + hinzufügen zur LogList
|
||||
n1.getScreenVertex().setColor(Color.RED);
|
||||
n2.getScreenVertex().setColor(Color.RED);
|
||||
textDescription = "Startknoten: " + n1.getScreenVertex().getMarking()
|
||||
+ ", Endknoten: " + n2.getScreenVertex().getMarking();
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
|
||||
while (!queue.isEmpty()) {
|
||||
// Den nächsten Knoten, der am wenigsten kostet, besuchen
|
||||
@@ -223,8 +252,29 @@ public class DirectedGraph<T extends VertexMarking, U extends EdgeMarking> exten
|
||||
|
||||
|
||||
// Logging
|
||||
System.out.println("Visit " + nextVertex.getElement().getName());
|
||||
this.logList.add(new OurLogElement(step, "Step: " + step, 0, nextVertex.getElement().getScreenVertex()));
|
||||
textDescription = "Visit " + nextVertex.getElement().getName();
|
||||
System.out.println(textDescription);
|
||||
nextVertex.getElement().getScreenVertex().setColor(Color.BLUE);
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
|
||||
// Wenn Weg gefunden, brich ab
|
||||
if (nextVertex.getElement() == n2) {
|
||||
MarkedVertex<T> colorroute = n2;
|
||||
while (colorroute != null) {
|
||||
textDescription = colorroute.getName();
|
||||
System.out.println(textDescription);
|
||||
colorroute.getScreenVertex().setColor(Color.green);
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
colorroute = predecessors.get(colorroute);
|
||||
}
|
||||
|
||||
|
||||
//zurücksetzten der Färbungen
|
||||
this.clearScreenGraphColor();
|
||||
return distance.get(n2);
|
||||
}
|
||||
|
||||
|
||||
// Gehe von diesem Knoten aus alle erreichbaren Knoten durch
|
||||
@@ -235,7 +285,145 @@ public class DirectedGraph<T extends VertexMarking, U extends EdgeMarking> exten
|
||||
if (j.getSource() == nextVertex.getElement() && j.getDestination() == i) {
|
||||
|
||||
// Berechne Distanz zu nächstem Knoten
|
||||
dist = distance.get(nextVertex.getElement()) + j.getWeighting();
|
||||
EdgeWeightMarking marking = (EdgeWeightMarking) j.getMarking();
|
||||
dist = distance.get(nextVertex.getElement()) + marking.getWeight();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Wenn es schon einen kürzeren Weg zum Knoten gibt, überspringen
|
||||
if ((distance.get(i) <= dist && distance.get(i) != -1) || visited.get(i)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Vorgänger aktualisieren
|
||||
predecessors.put(i, nextVertex.getElement());
|
||||
|
||||
// Aktualisiere Distanz von Start zu nächstem Knoten
|
||||
distance.put(i, dist);
|
||||
|
||||
// Logging
|
||||
textDescription = "Add " + i.getName() + " with " + dist + " weight to queue.";
|
||||
System.out.println(textDescription);
|
||||
i.getScreenVertex().setColor(Color.YELLOW);
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
// Nehme nächsten Knoten in die Queue auf
|
||||
queue.add(new WrapperElement<>(i, dist));
|
||||
}
|
||||
}
|
||||
|
||||
//zurücksetzten der Färbungen
|
||||
this.clearScreenGraphColor();
|
||||
|
||||
MarkedVertex<T> colorroute = n2;
|
||||
while (colorroute != null) {
|
||||
textDescription = colorroute.getName();
|
||||
System.out.println(textDescription);
|
||||
colorroute.getScreenVertex().setColor(Color.green);
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
colorroute = predecessors.get(colorroute);
|
||||
}
|
||||
|
||||
System.out.println("Done");
|
||||
// Gibt Distanz zu gefragtem Knoten zurück
|
||||
return distance.get(n2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getShortestPathAStar(MarkedVertex<T> n1, MarkedVertex<T> n2) {
|
||||
|
||||
// Erstellt Hashmap um Distanz von Startnoten zu jedem Knoten auf dem Graph zu tracken
|
||||
// Erstellt Hashmap um zu tracken welche Knoten schon besucht wurden
|
||||
// Erstelle Hashmap um Vorgängerknoten zu tracken
|
||||
// Initialisierung aller Distanzen auf UNENDLICH (= -1)
|
||||
// Initialisierung, dass kein Knoten besucht wurde
|
||||
// Initialisierung aller Vorgänger auf null
|
||||
HashMap<MarkedVertex<T>, Integer> distance = new HashMap<>();
|
||||
HashMap<MarkedVertex<T>, Boolean> visited = new HashMap<>();
|
||||
HashMap<MarkedVertex<T>, MarkedVertex<T>> predecessors = new HashMap<>();
|
||||
for (MarkedVertex<T> i: this.getAllVertexes()) {
|
||||
distance.put(i, -1);
|
||||
visited.put(i, false);
|
||||
predecessors.put(i, null);
|
||||
}
|
||||
|
||||
// Erstelle Schlange wo die nächsten Verbindungen drin sind
|
||||
PriorityQueue<WrapperElement<T>> queue = new PriorityQueue<>(new WrapperComparator<T>());
|
||||
|
||||
// Distanz zu Startknoten auf 0
|
||||
// Weg zu Startknoten in die Schlange aufnehmen
|
||||
distance.put(n1, 0);
|
||||
queue.add(new WrapperElement<>(n1, 0));
|
||||
|
||||
// Variable, die Distanz zwischen aktuellem Knoten und Nachfolger speichert
|
||||
int dist = 0;
|
||||
// Variable, die Distanz zwischen dem potenziell nächsten Knoten und dem Zielknoten speichert
|
||||
int airDist = 0;
|
||||
// Variable, die Distanz zwischen dem aktuellen Knoten bis zum Endknoten speichert
|
||||
int distToFinish = 0;
|
||||
// Zähler für LogList
|
||||
int step = 0;
|
||||
// String für den Description Inhalt
|
||||
String textDescription;
|
||||
|
||||
// Färben der Start und Ziel Knoten für Visualisierung + hinzufügen zur LogList
|
||||
n1.getScreenVertex().setColor(Color.RED);
|
||||
n2.getScreenVertex().setColor(Color.RED);
|
||||
textDescription = "Startknoten: " + n1.getScreenVertex().getMarking()
|
||||
+ ", Endknoten: " + n2.getScreenVertex().getMarking();
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
while (!queue.isEmpty()) {
|
||||
// Den nächsten Knoten, der am wenigsten kostet, besuchen
|
||||
WrapperElement<T> nextVertex = queue.poll();
|
||||
|
||||
// Knoten als besucht makieren
|
||||
visited.put(nextVertex.getElement(), true);
|
||||
|
||||
|
||||
// Logging
|
||||
textDescription = "Visit " + nextVertex.getElement().getName();
|
||||
System.out.println(textDescription);
|
||||
nextVertex.getElement().getScreenVertex().setColor(Color.BLUE);
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
// Wenn Weg gefunden, brich ab
|
||||
if (nextVertex.getElement() == n2) {
|
||||
MarkedVertex<T> colorroute = n2;
|
||||
while (colorroute != null) {
|
||||
textDescription = colorroute.getName();
|
||||
System.out.println(textDescription);
|
||||
colorroute.getScreenVertex().setColor(Color.green);
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
colorroute = predecessors.get(colorroute);
|
||||
}
|
||||
|
||||
|
||||
//zurücksetzten der Färbungen
|
||||
this.clearScreenGraphColor();
|
||||
return distance.get(n2);
|
||||
}
|
||||
|
||||
|
||||
// Gehe von diesem Knoten aus alle erreichbaren Knoten durch
|
||||
for (MarkedVertex<T> i: this.getSuccessors(nextVertex.getElement())) {
|
||||
|
||||
// Kante finde, die den jetzigen und nächsten Knoten verbindet
|
||||
for (MarkedEdge<U> j: this.getAllEdges()) {
|
||||
if (j.getSource() == nextVertex.getElement() && j.getDestination() == i) {
|
||||
|
||||
//Berechnung der Heuristik über die Luftdistanz des nächsten Knoten zum Zielknoten
|
||||
airDist = (int) Math.sqrt(Math.pow((i.getCords()[0] - n2.getCords()[0]), 2)
|
||||
+ Math.pow((i.getCords()[1] - n2.getCords()[1]), 2));
|
||||
|
||||
// Berechne Distanz zu nächstem Knoten
|
||||
EdgeWeightMarking marking = (EdgeWeightMarking) j.getMarking();
|
||||
dist = distance.get(nextVertex.getElement()) + marking.getWeight();
|
||||
distToFinish = distance.get(nextVertex.getElement()) + marking.getWeight() + airDist;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -249,14 +437,29 @@ public class DirectedGraph<T extends VertexMarking, U extends EdgeMarking> exten
|
||||
distance.put(i, dist);
|
||||
|
||||
// Logging
|
||||
System.out.println("Add " + i.getName() + " with " + dist + " weight to queue.");
|
||||
this.logList.add(new OurLogElement(step, "Step: " + step, 0, nextVertex.getElement().getScreenVertex()));
|
||||
textDescription = "Add " + i.getName() + " with " + dist + " weight to queue.";
|
||||
System.out.println(textDescription);
|
||||
i.getScreenVertex().setColor(Color.YELLOW);
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
// Nehme nächsten Knoten in die Queue auf
|
||||
queue.add(new WrapperElement<>(i, dist));
|
||||
queue.add(new WrapperElement<>(i, distToFinish));
|
||||
}
|
||||
}
|
||||
|
||||
//zurücksetzten der Färbungen
|
||||
this.clearScreenGraphColor();
|
||||
|
||||
MarkedVertex<T> colorroute = n2;
|
||||
while (colorroute != null) {
|
||||
textDescription = colorroute.getName();
|
||||
System.out.println(textDescription);
|
||||
colorroute.getScreenVertex().setColor(Color.green);
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
colorroute = predecessors.get(colorroute);
|
||||
}
|
||||
|
||||
System.out.println("Done");
|
||||
// Gibt Distanz zu gefragtem Knoten zurück
|
||||
return distance.get(n2);
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
package graph;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class Display {
|
||||
|
||||
public static void main(String[] args) {
|
||||
DirectedGraph<VertexMarking, EdgeMarking> myGraph = new DirectedGraph<>();
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
myGraph.addVertex(new MarkedVertex<>(String.valueOf(i), null));
|
||||
}
|
||||
Random random = new Random();
|
||||
|
||||
for (MarkedVertex<VertexMarking> i: myGraph.getAllVertexes()) {
|
||||
myGraph.addEdge(new MarkedEdge<>("a", i, myGraph.getAllVertexes().get(random.nextInt(myGraph.getAllVertexes().size())), null, random.nextInt(1, 10)));
|
||||
}
|
||||
|
||||
for (MarkedVertex<VertexMarking> i: myGraph.getAllVertexes()) {
|
||||
myGraph.addEdge(new MarkedEdge<>("a", i, myGraph.getAllVertexes().get(random.nextInt(myGraph.getAllVertexes().size())), null, random.nextInt(1, 10)));
|
||||
}
|
||||
|
||||
System.out.println(myGraph.toString());
|
||||
|
||||
MarkedVertex<VertexMarking> start = myGraph.getAllVertexes().get(random.nextInt(myGraph.getAllVertexes().size()));
|
||||
MarkedVertex<VertexMarking> end = myGraph.getAllVertexes().get(random.nextInt(myGraph.getAllVertexes().size()));
|
||||
System.out.println(start.getName() + " to " + end.getName());
|
||||
|
||||
System.out.println(myGraph.getShortestPathDijkstra(start, end));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,3 +2,18 @@ package graph;
|
||||
|
||||
public abstract class EdgeMarking extends Marking{
|
||||
}
|
||||
|
||||
class EdgeWeightMarking extends EdgeMarking{
|
||||
private int weight;
|
||||
|
||||
EdgeWeightMarking(int weight){
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public void setWeight(int weight){
|
||||
this.weight=weight;
|
||||
}
|
||||
public int getWeight(){
|
||||
return this.weight;
|
||||
}
|
||||
}
|
||||
|
||||
249
graph/ExampleGraphs.java
Normal file
249
graph/ExampleGraphs.java
Normal file
@@ -0,0 +1,249 @@
|
||||
package graph;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ExampleGraphs {
|
||||
|
||||
public DirectedGraph<VertexMarking, EdgeMarking> example1() {
|
||||
|
||||
/*
|
||||
* Beispiel 1 zeigt ein Gitter aus Knoten und Kanten, bei dem jeder Knoten mit
|
||||
* seinen horizontal und vertikal benachbarten Knoten verbunden ist. Alle Kanten
|
||||
* haben die gleiche Gewichtung. Der Startknoten befindet sich in einer Ecke
|
||||
* des Gitters und der Zielknoten in der gegenüberliegenden Ecke.
|
||||
*
|
||||
* Ziel:
|
||||
* Demonstrieren, wie der A*-Algorithmus durch gezieltere Suche effizienter ist
|
||||
* als der Dijkstra-Algorithmus in einem strukturierten Gittergraphen.
|
||||
*
|
||||
* Startknoten: A
|
||||
* Endknoten: Y
|
||||
*/
|
||||
|
||||
DirectedGraph<VertexMarking, EdgeMarking> example1 = new DirectedGraph<>();
|
||||
|
||||
int size = 5;
|
||||
MarkedVertex<VertexMarking>[][] vertices = new MarkedVertex[size][size];
|
||||
|
||||
// Knoten erstellen und zum Graph hinzufügen
|
||||
for (int row = 0; row < size; row++) {
|
||||
for (int col = 0; col < size; col++) {
|
||||
String name = String.valueOf((char) ('A' + row * size + col));
|
||||
if (name.equals("A")) {
|
||||
name = "Start";
|
||||
} else if (name.equals("Y")) {
|
||||
name = "Ende";
|
||||
}
|
||||
vertices[row][col] = new MarkedVertex<>(50 + col * 100, 50 + row * 100, name, null, null);
|
||||
example1.addVertex(vertices[row][col]);
|
||||
}
|
||||
}
|
||||
|
||||
// Kanten horizontal und vertikal verbinden
|
||||
for (int row = 0; row < size; row++) {
|
||||
for (int col = 0; col < size; col++) {
|
||||
if (col < size - 1) {
|
||||
addBidirectionalEdge(example1, vertices[row][col], vertices[row][col + 1], new EdgeWeightMarking(1));
|
||||
}
|
||||
if (row < size - 1) {
|
||||
addBidirectionalEdge(example1, vertices[row][col], vertices[row + 1][col], new EdgeWeightMarking(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return example1;
|
||||
}
|
||||
|
||||
private void addBidirectionalEdge(DirectedGraph<VertexMarking, EdgeMarking> graph, MarkedVertex<VertexMarking> from, MarkedVertex<VertexMarking> to, EdgeWeightMarking weight) {
|
||||
MarkedEdge<EdgeMarking> forwardEdge = new MarkedEdge<>("edge" + from.getName() + "_" + to.getName(), from, to, weight);
|
||||
MarkedEdge<EdgeMarking> backwardEdge = new MarkedEdge<>("edge" + to.getName() + "_" + from.getName(), to, from, weight);
|
||||
graph.addEdge(forwardEdge);
|
||||
graph.addEdge(backwardEdge);
|
||||
}
|
||||
|
||||
public DirectedGraph<VertexMarking, EdgeMarking> example2() {
|
||||
DirectedGraph<VertexMarking, EdgeMarking> example2 = new DirectedGraph<>();
|
||||
|
||||
|
||||
/*
|
||||
* Beispiel 2 zeigt zwei Wege von einem Startknoten zu einem Zielknoten mit unterschiedlichen Eigenschaften:
|
||||
* Ein Weg (oben) hat wenige Knoten mit Kanten geringer Gewichtung, außer der letzten Kante, die hohe Gewichtung hat.
|
||||
* Der andere Weg (unten) hat mehr Knoten mit höherer Gewichtung der Kanten. Der Algorithmus sollte zuerst den oberen
|
||||
* Weg erkunden, bis er die hohe Gewichtung der letzten Kante des unteren Wegs berücksichtigt.
|
||||
*
|
||||
* Startknoten: A
|
||||
* Endknoten: E
|
||||
*/
|
||||
|
||||
MarkedVertex A = new MarkedVertex<>(100, 100, "Start", null, null);
|
||||
MarkedVertex B = new MarkedVertex<>(250, 50, "B", null, null);
|
||||
MarkedVertex C = new MarkedVertex<>(400, 100, "C", null, null);
|
||||
MarkedVertex D = new MarkedVertex<>(550, 50, "D", null, null);
|
||||
MarkedVertex E = new MarkedVertex<>(700, 100, "Ende", null, null);
|
||||
MarkedVertex F = new MarkedVertex<>(250, 200, "F", null, null);
|
||||
MarkedVertex G = new MarkedVertex<>(550, 200, "G", null, null);
|
||||
|
||||
example2.addVertex(A);
|
||||
example2.addVertex(B);
|
||||
example2.addVertex(C);
|
||||
example2.addVertex(D);
|
||||
example2.addVertex(E);
|
||||
example2.addVertex(F);
|
||||
example2.addVertex(G);
|
||||
|
||||
example2.addEdge(new MarkedEdge<>("AB", A, B, new EdgeWeightMarking(1)));
|
||||
example2.addEdge(new MarkedEdge<>("BC", B, C, new EdgeWeightMarking(1)));
|
||||
example2.addEdge(new MarkedEdge<>("CD", C, D, new EdgeWeightMarking(10)));
|
||||
example2.addEdge(new MarkedEdge<>("DE", D, E, new EdgeWeightMarking(1)));
|
||||
|
||||
example2.addEdge(new MarkedEdge<>("AF", A, F, new EdgeWeightMarking(5)));
|
||||
example2.addEdge(new MarkedEdge<>("FG", F, G, new EdgeWeightMarking(5)));
|
||||
example2.addEdge(new MarkedEdge<>("GE", G, E, new EdgeWeightMarking(5)));
|
||||
|
||||
return example2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public DirectedGraph<VertexMarking, EdgeMarking> example3() {
|
||||
|
||||
/*
|
||||
* Beispiel 3 zeigt ein Labyrinth mit vier horizontalen Wegen, die jeweils aus vier Knoten bestehen.
|
||||
* Jeder Weg führt zum Endpunkt E1, E2, E3 bzw. E4. Ziel ist es zu zeigen, dass die Algorithmen auch
|
||||
* potenziell falsche Wege erkunden können, bevor sie den richtigen Endpunkt erreichen.
|
||||
*
|
||||
* Startknoten: A
|
||||
* Endknoten: E2
|
||||
*/
|
||||
|
||||
DirectedGraph<VertexMarking, EdgeMarking> example3 = new DirectedGraph<>();
|
||||
|
||||
// Startpunkt A in der Mitte der Y-Koordinate
|
||||
MarkedVertex A = new MarkedVertex<>(100, 250, "Start", null, null);
|
||||
|
||||
// Erster Weg
|
||||
MarkedVertex B1 = new MarkedVertex<>(200, 100, "B1", null, null);
|
||||
MarkedVertex C1 = new MarkedVertex<>(300, 100, "C1", null, null);
|
||||
MarkedVertex D1 = new MarkedVertex<>(400, 100, "D1", null, null);
|
||||
MarkedVertex E1 = new MarkedVertex<>(500, 100, "E1", null, null); // Endpunkt des ersten Weges
|
||||
|
||||
// Zweiter Weg
|
||||
MarkedVertex B2 = new MarkedVertex<>(200, 200, "B2", null, null);
|
||||
MarkedVertex C2 = new MarkedVertex<>(300, 200, "C2", null, null);
|
||||
MarkedVertex D2 = new MarkedVertex<>(400, 200, "D2", null, null);
|
||||
MarkedVertex E2 = new MarkedVertex<>(500, 200, "E2", null, null); // Endpunkt des zweiten Weges
|
||||
|
||||
// Dritter Weg
|
||||
MarkedVertex B3 = new MarkedVertex<>(200, 300, "B3", null, null);
|
||||
MarkedVertex C3 = new MarkedVertex<>(300, 300, "C3", null, null);
|
||||
MarkedVertex D3 = new MarkedVertex<>(400, 300, "D3", null, null);
|
||||
MarkedVertex E3 = new MarkedVertex<>(500, 300, "E3", null, null); // Endpunkt des dritten Weges
|
||||
|
||||
// Vierter Weg
|
||||
MarkedVertex B4 = new MarkedVertex<>(200, 400, "B4", null, null);
|
||||
MarkedVertex C4 = new MarkedVertex<>(300, 400, "C4", null, null);
|
||||
MarkedVertex D4 = new MarkedVertex<>(400, 400, "D4", null, null);
|
||||
MarkedVertex E4 = new MarkedVertex<>(500, 400, "Ende", null, null); // Endpunkt des vierten Weges
|
||||
|
||||
example3.addVertex(A);
|
||||
example3.addVertex(B1);
|
||||
example3.addVertex(C1);
|
||||
example3.addVertex(D1);
|
||||
example3.addVertex(B2);
|
||||
example3.addVertex(C2);
|
||||
example3.addVertex(D2);
|
||||
example3.addVertex(B3);
|
||||
example3.addVertex(C3);
|
||||
example3.addVertex(D3);
|
||||
example3.addVertex(B4);
|
||||
example3.addVertex(C4);
|
||||
example3.addVertex(D4);
|
||||
example3.addVertex(E1);
|
||||
example3.addVertex(E2);
|
||||
example3.addVertex(E3);
|
||||
example3.addVertex(E4);
|
||||
|
||||
example3.addEdge(new MarkedEdge<>("AB1", A, B1, new EdgeWeightMarking(1)));
|
||||
example3.addEdge(new MarkedEdge<>("AB2", A, B2, new EdgeWeightMarking(1)));
|
||||
example3.addEdge(new MarkedEdge<>("AB3", A, B3, new EdgeWeightMarking(1)));
|
||||
example3.addEdge(new MarkedEdge<>("AB4", A, B4, new EdgeWeightMarking(1)));
|
||||
|
||||
example3.addEdge(new MarkedEdge<>("B1C1", B1, C1, new EdgeWeightMarking(1)));
|
||||
example3.addEdge(new MarkedEdge<>("B2C2", B2, C2, new EdgeWeightMarking(1)));
|
||||
example3.addEdge(new MarkedEdge<>("B3C3", B3, C3, new EdgeWeightMarking(1)));
|
||||
example3.addEdge(new MarkedEdge<>("B4C4", B4, C4, new EdgeWeightMarking(1)));
|
||||
|
||||
example3.addEdge(new MarkedEdge<>("C1D1", C1, D1, new EdgeWeightMarking(1)));
|
||||
example3.addEdge(new MarkedEdge<>("C2D2", C2, D2, new EdgeWeightMarking(1)));
|
||||
example3.addEdge(new MarkedEdge<>("C3D3", C3, D3, new EdgeWeightMarking(1)));
|
||||
example3.addEdge(new MarkedEdge<>("C4D4", C4, D4, new EdgeWeightMarking(1)));
|
||||
|
||||
example3.addEdge(new MarkedEdge<>("D1E1", D1, E1, new EdgeWeightMarking(1)));
|
||||
example3.addEdge(new MarkedEdge<>("D2E2", D2, E2, new EdgeWeightMarking(1)));
|
||||
example3.addEdge(new MarkedEdge<>("D3E3", D3, E3, new EdgeWeightMarking(1)));
|
||||
example3.addEdge(new MarkedEdge<>("D4E4", D4, E4, new EdgeWeightMarking(1)));
|
||||
|
||||
return example3;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public DirectedGraph<VertexMarking, EdgeMarking> example4() {
|
||||
|
||||
/**
|
||||
* Erstellt einen Beispielgraphen (Beispiel 4), der sich ideal für die Demonstration der Funktionsweise
|
||||
* des Dijkstra- und A*-Algorithmus eignet. Der Graph enthält eine Vielzahl von Knoten, die durch
|
||||
* gewichtete Kanten verbunden sind. Dies ermöglicht es, den kürzesten Weg von einem Startknoten zu einem
|
||||
* Zielknoten effizient zu berechnen und die Unterschiede zwischen den beiden Algorithmen in der
|
||||
* Pfadfindung zu veranschaulichen.
|
||||
*
|
||||
* Startknoten: A
|
||||
* Zielknoten: H
|
||||
*
|
||||
*/
|
||||
|
||||
DirectedGraph<VertexMarking, EdgeMarking> example4 = new DirectedGraph<>();
|
||||
|
||||
// Erstellung der Knoten mit Koordinaten
|
||||
MarkedVertex<VertexMarking> A = new MarkedVertex<>(50, 250, "Start", null, null);
|
||||
MarkedVertex<VertexMarking> B = new MarkedVertex<>(150, 150, "B", null, null);
|
||||
MarkedVertex<VertexMarking> C = new MarkedVertex<>(150, 350, "C", null, null);
|
||||
MarkedVertex<VertexMarking> D = new MarkedVertex<>(250, 100, "D", null, null);
|
||||
MarkedVertex<VertexMarking> E = new MarkedVertex<>(250, 250, "E", null, null);
|
||||
MarkedVertex<VertexMarking> F = new MarkedVertex<>(350, 200, "F", null, null);
|
||||
MarkedVertex<VertexMarking> G = new MarkedVertex<>(450, 300, "G", null, null);
|
||||
MarkedVertex<VertexMarking> H = new MarkedVertex<>(450, 100, "Ende", null, null);
|
||||
|
||||
|
||||
// Hinzufügen der Knoten zum Graphen
|
||||
example4.addVertex(A);
|
||||
example4.addVertex(B);
|
||||
example4.addVertex(C);
|
||||
example4.addVertex(D);
|
||||
example4.addVertex(E);
|
||||
example4.addVertex(F);
|
||||
example4.addVertex(G);
|
||||
example4.addVertex(H);
|
||||
|
||||
// Erstellung der Kanten mit Gewichtungen
|
||||
example4.addEdge(new MarkedEdge<>("AB", A, B, new EdgeWeightMarking(4)));
|
||||
example4.addEdge(new MarkedEdge<>("AC", A, C, new EdgeWeightMarking(2)));
|
||||
example4.addEdge(new MarkedEdge<>("BC", B, C, new EdgeWeightMarking(5)));
|
||||
example4.addEdge(new MarkedEdge<>("BD", B, D, new EdgeWeightMarking(10)));
|
||||
example4.addEdge(new MarkedEdge<>("CD", C, D, new EdgeWeightMarking(3)));
|
||||
example4.addEdge(new MarkedEdge<>("CE", C, E, new EdgeWeightMarking(7)));
|
||||
example4.addEdge(new MarkedEdge<>("DE", D, E, new EdgeWeightMarking(2)));
|
||||
example4.addEdge(new MarkedEdge<>("DF", D, F, new EdgeWeightMarking(2)));
|
||||
example4.addEdge(new MarkedEdge<>("EF", E, F, new EdgeWeightMarking(5)));
|
||||
example4.addEdge(new MarkedEdge<>("EG", E, G, new EdgeWeightMarking(10)));
|
||||
example4.addEdge(new MarkedEdge<>("FG", F, G, new EdgeWeightMarking(3)));
|
||||
example4.addEdge(new MarkedEdge<>("FH", F, H, new EdgeWeightMarking(6)));
|
||||
example4.addEdge(new MarkedEdge<>("GH", G, H, new EdgeWeightMarking(1)));
|
||||
|
||||
return example4;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package graph;
|
||||
import OurApplication.OurLogElement;
|
||||
import logging.LogElementList;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.*;
|
||||
|
||||
public abstract class Graph<T extends VertexMarking, U extends EdgeMarking> {
|
||||
@@ -265,6 +266,15 @@ public abstract class Graph<T extends VertexMarking, U extends EdgeMarking> {
|
||||
}
|
||||
|
||||
|
||||
// Methode für das Zurücksetzten der Knotenfarben
|
||||
public void clearScreenGraphColor(){
|
||||
for(visualizationElements.Vertex screenVertexes : this.getScreenGraph().getVertexes()){
|
||||
screenVertexes.setColor(Color.BLACK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public abstract int getShortestPathDijkstra(MarkedVertex<T> n1, MarkedVertex<T> n2);
|
||||
|
||||
public abstract int getShortestPathAStar(MarkedVertex<T> n1, MarkedVertex<T> n2);
|
||||
}
|
||||
|
||||
@@ -7,8 +7,6 @@ public class MarkedEdge<U extends EdgeMarking> extends Edge{
|
||||
// ATTRIBUTE
|
||||
|
||||
private U marking;
|
||||
// Für Aufgabe 2
|
||||
private int weighting;
|
||||
|
||||
private visualizationElements.Edge screenEdge;
|
||||
|
||||
@@ -24,18 +22,11 @@ public class MarkedEdge<U extends EdgeMarking> extends Edge{
|
||||
public MarkedEdge(String s, Vertex n1, Vertex n2, U u) {
|
||||
super(s, n1, n2);
|
||||
this.marking = u;
|
||||
this.screenEdge = new visualizationElements.Edge(n1.getScreenVertex(), n2.getScreenVertex(), u.toString());
|
||||
EdgeWeightMarking m = (EdgeWeightMarking) this.marking;
|
||||
this.screenEdge = new visualizationElements.Edge(n1.getScreenVertex(), n2.getScreenVertex(), Integer.toString(m.getWeight()), Color.BLACK);
|
||||
}
|
||||
|
||||
|
||||
// TODO ACHTUNG DEBUG!!!!
|
||||
public MarkedEdge(String s, Vertex n1, Vertex n2, U u, int w) {
|
||||
super(s, n1, n2);
|
||||
this.marking = u;
|
||||
this.weighting = w;
|
||||
this.screenEdge = new visualizationElements.Edge(n1.getScreenVertex(), n2.getScreenVertex(), "u.toString()", Color.BLACK);
|
||||
}
|
||||
|
||||
|
||||
// GET-ER
|
||||
|
||||
@@ -44,12 +35,6 @@ public class MarkedEdge<U extends EdgeMarking> extends Edge{
|
||||
}
|
||||
|
||||
|
||||
// Für Aufgabe 2
|
||||
public int getWeighting() {
|
||||
return this.weighting;
|
||||
}
|
||||
|
||||
|
||||
public visualizationElements.Edge getScreenEdge() {
|
||||
return this.screenEdge;
|
||||
}
|
||||
@@ -59,14 +44,11 @@ public class MarkedEdge<U extends EdgeMarking> extends Edge{
|
||||
|
||||
public void setMarking(U u) {
|
||||
this.marking = u;
|
||||
EdgeWeightMarking m = (EdgeWeightMarking) this.marking;
|
||||
this.screenEdge.setMarking(Integer.toString(m.getWeight()));
|
||||
}
|
||||
|
||||
|
||||
// Für Aufgabe 2
|
||||
public void setWeighting(int w) {
|
||||
this.weighting = w;
|
||||
}
|
||||
|
||||
|
||||
// Ausgabe
|
||||
public String toString() {
|
||||
|
||||
@@ -27,17 +27,16 @@ public class MarkedVertex<T extends VertexMarking> extends Vertex{
|
||||
public MarkedVertex(String s, T t) {
|
||||
super(s);
|
||||
this.marking = t;
|
||||
this.screenVertex = new visualizationElements.Vertex(0, 0, t.toString());
|
||||
this.screenVertex = new visualizationElements.Vertex(0, 0);
|
||||
this.xCord = 0;
|
||||
this.yCord = 0;
|
||||
}
|
||||
|
||||
|
||||
// TODO ACHTUNG DEBUG!!!!
|
||||
public MarkedVertex(int xCord, int yCord, String s, T t, Color color) {
|
||||
super(s);
|
||||
public MarkedVertex(int xCord, int yCord, String name, T t, Color color) {
|
||||
super(name);
|
||||
this.marking = t;
|
||||
this.screenVertex = new visualizationElements.Vertex(xCord, yCord, "t.toString()", color);
|
||||
this.screenVertex = new visualizationElements.Vertex(xCord, yCord, name, color);
|
||||
this.xCord = xCord;
|
||||
this.yCord = yCord;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,10 @@ import visualizationElements.Edge;
|
||||
import visualizationElements.EdgeStyle;
|
||||
import visualizationElements.Vertex;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
import java.util.PriorityQueue;
|
||||
import java.util.Vector;
|
||||
|
||||
public class UndirectedGraph<T extends VertexMarking, U extends EdgeMarking> extends Graph<T, U> {
|
||||
@@ -45,6 +48,24 @@ public class UndirectedGraph<T extends VertexMarking, U extends EdgeMarking> ext
|
||||
}
|
||||
|
||||
|
||||
public visualizationElements.Graph getScreenGraphCopy() {
|
||||
visualizationElements.Graph graphCopy = new visualizationElements.Graph(new Vector<Vertex>(), new Vector<Edge>(), false, EdgeStyle.Direct);
|
||||
Vector<visualizationElements.Vertex> copiedVertexes = new Vector<>();
|
||||
Vector<visualizationElements.Edge> copiedEdges = new Vector<>();
|
||||
for (visualizationElements.Vertex vertexCopy : this.screenGraph.getVertexes()) {
|
||||
visualizationElements.Vertex newCopiedVertex = new visualizationElements.Vertex(vertexCopy.getXpos(), vertexCopy.getYpos(), vertexCopy.getMarking(), vertexCopy.getColor());
|
||||
copiedVertexes.add(newCopiedVertex);
|
||||
graphCopy.setVertexes(copiedVertexes);
|
||||
}
|
||||
for (visualizationElements.Edge edgeCopy : this.screenGraph.getEdges()) {
|
||||
visualizationElements.Edge newCopiedEdge = new visualizationElements.Edge(edgeCopy.getSource(), edgeCopy.getDestination(), edgeCopy.getMarking(), edgeCopy.getColor());
|
||||
copiedEdges.add(newCopiedEdge);
|
||||
graphCopy.setEdges(copiedEdges);
|
||||
}
|
||||
return graphCopy;
|
||||
}
|
||||
|
||||
|
||||
// HINZUFÜGEN
|
||||
|
||||
// Kante hinzufügen
|
||||
@@ -119,7 +140,261 @@ public class UndirectedGraph<T extends VertexMarking, U extends EdgeMarking> ext
|
||||
|
||||
|
||||
public int getShortestPathDijkstra(MarkedVertex<T> n1, MarkedVertex<T> n2) {
|
||||
return 1;
|
||||
|
||||
// Erstellt Hashmap um Distanz von Startnoten zu jedem Knoten auf dem Graph zu tracken
|
||||
// Erstellt Hashmap um zu tracken welche Knoten schon besucht wurden
|
||||
// Erstelle Hashmap um Vorgängerknoten zu tracken
|
||||
// Initialisierung aller Distanzen auf UNENDLICH (= -1)
|
||||
// Initialisierung, dass kein Knoten besucht wurde
|
||||
// Initialisierung aller Vorgänger auf null
|
||||
HashMap<MarkedVertex<T>, Integer> distance = new HashMap<>();
|
||||
HashMap<MarkedVertex<T>, Boolean> visited = new HashMap<>();
|
||||
HashMap<MarkedVertex<T>, MarkedVertex<T>> predecessors = new HashMap<>();
|
||||
for (MarkedVertex<T> i: this.getAllVertexes()) {
|
||||
distance.put(i, -1);
|
||||
visited.put(i, false);
|
||||
predecessors.put(i, null);
|
||||
}
|
||||
|
||||
// Erstelle Schlange wo die nächsten Verbindungen drin sind
|
||||
PriorityQueue<WrapperElement<T>> queue = new PriorityQueue<>(new WrapperComparator<T>());
|
||||
|
||||
// Distanz zu Startknoten auf 0
|
||||
// Weg zu Startknoten in die Schlange aufnehmen
|
||||
distance.put(n1, 0);
|
||||
queue.add(new WrapperElement<>(n1, 0));
|
||||
|
||||
// Variable, die Distanz zwischen aktuellem Knoten und Nachfolger speichert
|
||||
int dist = 0;
|
||||
// Zähler für LogList
|
||||
int step = 0;
|
||||
// String für den Description Inhalt
|
||||
String textDescription;
|
||||
|
||||
// Färben der Start und Ziel Knoten für Visualisierung + hinzufügen zur LogList
|
||||
n1.getScreenVertex().setColor(Color.RED);
|
||||
n2.getScreenVertex().setColor(Color.RED);
|
||||
textDescription = "Startknoten: " + n1.getScreenVertex().getMarking()
|
||||
+ ", Endknoten: " + n2.getScreenVertex().getMarking();
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
while (!queue.isEmpty()) {
|
||||
// Den nächsten Knoten, der am wenigsten kostet, besuchen
|
||||
WrapperElement<T> nextVertex = queue.poll();
|
||||
|
||||
// Knoten als besucht makieren
|
||||
visited.put(nextVertex.getElement(), true);
|
||||
|
||||
|
||||
// Logging
|
||||
textDescription = "Visit " + nextVertex.getElement().getName();
|
||||
System.out.println(textDescription);
|
||||
nextVertex.getElement().getScreenVertex().setColor(Color.BLUE);
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
|
||||
// Wenn Weg gefunden, brich ab
|
||||
if (nextVertex.getElement() == n2) {
|
||||
MarkedVertex<T> colorroute = n2;
|
||||
while (colorroute != null) {
|
||||
textDescription = colorroute.getName();
|
||||
System.out.println(textDescription);
|
||||
colorroute.getScreenVertex().setColor(Color.green);
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
colorroute = predecessors.get(colorroute);
|
||||
}
|
||||
|
||||
|
||||
//zurücksetzten der Färbungen
|
||||
this.clearScreenGraphColor();
|
||||
return distance.get(n2);
|
||||
}
|
||||
|
||||
|
||||
// Gehe von diesem Knoten aus alle erreichbaren Knoten durch
|
||||
for (MarkedVertex<T> i: this.getNeighbours(nextVertex.getElement())) {
|
||||
|
||||
// Kante finde, die den jetzigen und nächsten Knoten verbindet
|
||||
for (MarkedEdge<U> j: this.getAllEdges()) {
|
||||
if (j.getSource() == nextVertex.getElement() && j.getDestination() == i) {
|
||||
|
||||
// Berechne Distanz zu nächstem Knoten
|
||||
EdgeWeightMarking marking = (EdgeWeightMarking) j.getMarking();
|
||||
dist = distance.get(nextVertex.getElement()) + marking.getWeight();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Wenn es schon einen kürzeren Weg zum Knoten gibt, überspringen
|
||||
if ((distance.get(i) <= dist && distance.get(i) != -1) || visited.get(i)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Aktualisiere Distanz von Start zu nächstem Knoten
|
||||
distance.put(i, dist);
|
||||
|
||||
// Logging
|
||||
textDescription = "Add " + i.getName() + " with " + dist + " weight to queue.";
|
||||
System.out.println(textDescription);
|
||||
i.getScreenVertex().setColor(Color.YELLOW);
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
// Nehme nächsten Knoten in die Queue auf
|
||||
queue.add(new WrapperElement<>(i, dist));
|
||||
}
|
||||
}
|
||||
|
||||
//zurücksetzten der Färbungen
|
||||
this.clearScreenGraphColor();
|
||||
|
||||
MarkedVertex<T> colorroute = n2;
|
||||
while (colorroute != null) {
|
||||
textDescription = colorroute.getName();
|
||||
System.out.println(textDescription);
|
||||
colorroute.getScreenVertex().setColor(Color.green);
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
colorroute = predecessors.get(colorroute);
|
||||
}
|
||||
|
||||
System.out.println("Done");
|
||||
// Gibt Distanz zu gefragtem Knoten zurück
|
||||
return distance.get(n2);
|
||||
}
|
||||
|
||||
|
||||
public int getShortestPathAStar(MarkedVertex<T> n1, MarkedVertex<T> n2) {
|
||||
|
||||
// Erstellt Hashmap um Distanz von Startnoten zu jedem Knoten auf dem Graph zu tracken
|
||||
// Erstellt Hashmap um zu tracken welche Knoten schon besucht wurden
|
||||
// Erstelle Hashmap um Vorgängerknoten zu tracken
|
||||
// Initialisierung aller Distanzen auf UNENDLICH (= -1)
|
||||
// Initialisierung, dass kein Knoten besucht wurde
|
||||
// Initialisierung aller Vorgänger auf null
|
||||
HashMap<MarkedVertex<T>, Integer> distance = new HashMap<>();
|
||||
HashMap<MarkedVertex<T>, Boolean> visited = new HashMap<>();
|
||||
HashMap<MarkedVertex<T>, MarkedVertex<T>> predecessors = new HashMap<>();
|
||||
for (MarkedVertex<T> i: this.getAllVertexes()) {
|
||||
distance.put(i, -1);
|
||||
visited.put(i, false);
|
||||
predecessors.put(i, null);
|
||||
}
|
||||
|
||||
// Erstelle Schlange wo die nächsten Verbindungen drin sind
|
||||
PriorityQueue<WrapperElement<T>> queue = new PriorityQueue<>(new WrapperComparator<T>());
|
||||
|
||||
// Distanz zu Startknoten auf 0
|
||||
// Weg zu Startknoten in die Schlange aufnehmen
|
||||
distance.put(n1, 0);
|
||||
queue.add(new WrapperElement<>(n1, 0));
|
||||
|
||||
// Variable, die Distanz zwischen aktuellem Knoten und Nachfolger speichert
|
||||
int dist = 0;
|
||||
// Variable, die Distanz zwischen dem potenziell nächsten Knoten und dem Zielknoten speichert
|
||||
int airDist = 0;
|
||||
// Variable, die Distanz zwischen dem aktuellen Knoten bis zum Endknoten speichert
|
||||
int distToFinish = 0;
|
||||
// Zähler für LogList
|
||||
int step = 0;
|
||||
// String für den Description Inhalt
|
||||
String textDescription;
|
||||
|
||||
// Färben der Start und Ziel Knoten für Visualisierung + hinzufügen zur LogList
|
||||
n1.getScreenVertex().setColor(Color.RED);
|
||||
n2.getScreenVertex().setColor(Color.RED);
|
||||
textDescription = "Startknoten: " + n1.getScreenVertex().getMarking()
|
||||
+ ", Endknoten: " + n2.getScreenVertex().getMarking();
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
while (!queue.isEmpty()) {
|
||||
// Den nächsten Knoten, der am wenigsten kostet, besuchen
|
||||
WrapperElement<T> nextVertex = queue.poll();
|
||||
|
||||
// Knoten als besucht makieren
|
||||
visited.put(nextVertex.getElement(), true);
|
||||
|
||||
|
||||
// Logging
|
||||
textDescription = "Visit " + nextVertex.getElement().getName();
|
||||
System.out.println(textDescription);
|
||||
nextVertex.getElement().getScreenVertex().setColor(Color.BLUE);
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
|
||||
// Wenn Weg gefunden, brich ab
|
||||
if (nextVertex.getElement() == n2) {
|
||||
MarkedVertex<T> colorroute = n2;
|
||||
while (colorroute != null) {
|
||||
textDescription = colorroute.getName();
|
||||
System.out.println(textDescription);
|
||||
colorroute.getScreenVertex().setColor(Color.green);
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
colorroute = predecessors.get(colorroute);
|
||||
}
|
||||
|
||||
|
||||
//zurücksetzten der Färbungen
|
||||
this.clearScreenGraphColor();
|
||||
return distance.get(n2);
|
||||
}
|
||||
|
||||
|
||||
// Gehe von diesem Knoten aus alle erreichbaren Knoten durch
|
||||
for (MarkedVertex<T> i: this.getNeighbours(nextVertex.getElement())) {
|
||||
|
||||
// Kante finde, die den jetzigen und nächsten Knoten verbindet
|
||||
for (MarkedEdge<U> j: this.getAllEdges()) {
|
||||
if (j.getSource() == nextVertex.getElement() && j.getDestination() == i) {
|
||||
|
||||
//Berechnung der Heuristik über die Luftdistanz des nächsten Knoten zum Zielknoten
|
||||
airDist = (int) Math.sqrt(Math.pow((i.getCords()[0] - n2.getCords()[0]), 2)
|
||||
+ Math.pow((i.getCords()[1] - n2.getCords()[1]), 2));
|
||||
|
||||
// Berechne Distanz zu nächstem Knoten
|
||||
EdgeWeightMarking marking = (EdgeWeightMarking) j.getMarking();
|
||||
dist = distance.get(nextVertex.getElement()) + marking.getWeight();
|
||||
distToFinish = distance.get(nextVertex.getElement()) + marking.getWeight() + airDist;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Wenn es schon einen kürzeren Weg zum Knoten gibt, überspringen
|
||||
if ((distance.get(i) <= dist && distance.get(i) != -1) || visited.get(i)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Aktualisiere Distanz von Start zu nächstem Knoten
|
||||
distance.put(i, dist);
|
||||
|
||||
// Logging
|
||||
textDescription = "Add " + i.getName() + " with " + dist + " weight to queue.";
|
||||
System.out.println(textDescription);
|
||||
i.getScreenVertex().setColor(Color.YELLOW);
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
// Nehme nächsten Knoten in die Queue auf
|
||||
queue.add(new WrapperElement<>(i, distToFinish));
|
||||
}
|
||||
}
|
||||
|
||||
//zurücksetzten der Färbungen
|
||||
this.clearScreenGraphColor();
|
||||
|
||||
MarkedVertex<T> colorroute = n2;
|
||||
while (colorroute != null) {
|
||||
textDescription = colorroute.getName();
|
||||
System.out.println(textDescription);
|
||||
colorroute.getScreenVertex().setColor(Color.green);
|
||||
this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy()));
|
||||
|
||||
colorroute = predecessors.get(colorroute);
|
||||
}
|
||||
|
||||
System.out.println("Done");
|
||||
// Gibt Distanz zu gefragtem Knoten zurück
|
||||
return distance.get(n2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,3 +2,18 @@ package graph;
|
||||
|
||||
public abstract class VertexMarking extends Marking {
|
||||
}
|
||||
|
||||
class VertexWeightMarking extends VertexMarking{
|
||||
private int weight;
|
||||
|
||||
VertexWeightMarking(int weight){
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public void setWeight(int weight){
|
||||
this.weight=weight;
|
||||
}
|
||||
public int getWeight(){
|
||||
return this.weight;
|
||||
}
|
||||
}
|
||||
|
||||
1
out/production/ProjektGraph/.gitignore
vendored
Normal file
1
out/production/ProjektGraph/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/out/
|
||||
11
out/production/ProjektGraph/.idea/ProjektGraph.iml
generated
Normal file
11
out/production/ProjektGraph/.idea/ProjektGraph.iml
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
6
out/production/ProjektGraph/.idea/misc.xml
generated
Normal file
6
out/production/ProjektGraph/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="21" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
8
out/production/ProjektGraph/.idea/modules.xml
generated
Normal file
8
out/production/ProjektGraph/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/ProjektGraph.iml" filepath="$PROJECT_DIR$/.idea/ProjektGraph.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
124
out/production/ProjektGraph/.idea/uiDesigner.xml
generated
Normal file
124
out/production/ProjektGraph/.idea/uiDesigner.xml
generated
Normal file
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
</project>
|
||||
6
out/production/ProjektGraph/.idea/vcs.xml
generated
Normal file
6
out/production/ProjektGraph/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
185
out/production/ProjektGraph/.idea/workspace.xml
generated
Normal file
185
out/production/ProjektGraph/.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,185 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="LegendArea gestaltet">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/OurApplication/OurLogElement.java" beforeDir="false" afterPath="$PROJECT_DIR$/OurApplication/OurLogElement.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/OurApplication/OurTextArea.java" beforeDir="false" afterPath="$PROJECT_DIR$/OurApplication/OurTextArea.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/graph/DirectedGraph.java" beforeDir="false" afterPath="$PROJECT_DIR$/graph/DirectedGraph.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/OurLogElement.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurLogElement.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" />
|
||||
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurTextArea.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurTextArea.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" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||
<map>
|
||||
<entry key="$PROJECT_DIR$" value="ebd1173cbc514ede7aa65ba6be90702c92e0e8b4" />
|
||||
</map>
|
||||
</option>
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
<option name="RESET_MODE" value="HARD" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"associatedIndex": 2
|
||||
}</component>
|
||||
<component name="ProjectId" id="2hxt4apXjGaBR1xypJAsjIrgc8R" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"Application.Display.executor": "Run",
|
||||
"Application.OurApplication.executor": "Debug",
|
||||
"Application.OurLegendArea.executor": "Run",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"git-widget-placeholder": "main",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "C:/Git/ProjektGraphMain"
|
||||
}
|
||||
}</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="C:\Git\ProjektGraph" />
|
||||
</key>
|
||||
<key name="CopyClassDialog.RECENTS_KEY">
|
||||
<recent name="logging" />
|
||||
<recent name="visualisation" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="" />
|
||||
<created>1718547365327</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1718547365327</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="Stable Version 3.0">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720028543313</created>
|
||||
<option name="number" value="00001" />
|
||||
<option name="presentableId" value="LOCAL-00001" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720028543313</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00002" summary="Adding AStar Algorithm">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720036191925</created>
|
||||
<option name="number" value="00002" />
|
||||
<option name="presentableId" value="LOCAL-00002" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720036191926</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00003" summary="Adding AStar Algorithm">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720036227325</created>
|
||||
<option name="number" value="00003" />
|
||||
<option name="presentableId" value="LOCAL-00003" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720036227325</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00004" summary="Adding AStar Algorithm">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720042374225</created>
|
||||
<option name="number" value="00004" />
|
||||
<option name="presentableId" value="LOCAL-00004" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720042374225</updated>
|
||||
</task>
|
||||
<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>
|
||||
<task id="LOCAL-00006" summary="Stable Version 3.0">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720182049903</created>
|
||||
<option name="number" value="00006" />
|
||||
<option name="presentableId" value="LOCAL-00006" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720182049903</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00007" summary="Tests with marking of Edges and Vertexes Adding Visualisation of Edge weight and Vertex name fixed AStar">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720291413659</created>
|
||||
<option name="number" value="00007" />
|
||||
<option name="presentableId" value="LOCAL-00007" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720291413659</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00008" summary="small fix">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720293774580</created>
|
||||
<option name="number" value="00008" />
|
||||
<option name="presentableId" value="LOCAL-00008" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720293774580</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00009" summary="Beispiele überarbeitet">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720311867957</created>
|
||||
<option name="number" value="00009" />
|
||||
<option name="presentableId" value="LOCAL-00009" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720311867957</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00010" summary="LegendArea gestaltet">
|
||||
<option name="closed" value="true" />
|
||||
<created>1720347450647</created>
|
||||
<option name="number" value="00010" />
|
||||
<option name="presentableId" value="LOCAL-00010" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720347450647</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="11" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="Adding AStar Algorithm" />
|
||||
<MESSAGE value="Stable Version with finished visualisation" />
|
||||
<MESSAGE value="Stable Version 3.0" />
|
||||
<MESSAGE value="Tests with marking of Edges and Vertexes Adding Visualisation of Edge weight and Vertex name fixed AStar" />
|
||||
<MESSAGE value="small fix" />
|
||||
<MESSAGE value="Beispiele überarbeitet" />
|
||||
<MESSAGE value="LegendArea gestaltet" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="LegendArea gestaltet" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<breakpoints>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/OurApplication/OurApplication.java</url>
|
||||
<line>49</line>
|
||||
<option name="timeStamp" value="2" />
|
||||
</line-breakpoint>
|
||||
</breakpoints>
|
||||
</breakpoint-manager>
|
||||
</component>
|
||||
</project>
|
||||
BIN
out/production/ProjektGraph/OurApplication/OurAlgorithm.class
Normal file
BIN
out/production/ProjektGraph/OurApplication/OurAlgorithm.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/OurApplication/OurApplication.class
Normal file
BIN
out/production/ProjektGraph/OurApplication/OurApplication.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/OurApplication/OurDrawArea.class
Normal file
BIN
out/production/ProjektGraph/OurApplication/OurDrawArea.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/OurApplication/OurHybridWindow.class
Normal file
BIN
out/production/ProjektGraph/OurApplication/OurHybridWindow.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/OurApplication/OurLegendArea.class
Normal file
BIN
out/production/ProjektGraph/OurApplication/OurLegendArea.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/OurApplication/OurLogElement.class
Normal file
BIN
out/production/ProjektGraph/OurApplication/OurLogElement.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
out/production/ProjektGraph/OurApplication/OurTextArea.class
Normal file
BIN
out/production/ProjektGraph/OurApplication/OurTextArea.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
out/production/ProjektGraph/graph/DirectedGraph.class
Normal file
BIN
out/production/ProjektGraph/graph/DirectedGraph.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/graph/Edge.class
Normal file
BIN
out/production/ProjektGraph/graph/Edge.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/graph/EdgeMarking.class
Normal file
BIN
out/production/ProjektGraph/graph/EdgeMarking.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/graph/EdgeWeightMarking.class
Normal file
BIN
out/production/ProjektGraph/graph/EdgeWeightMarking.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/graph/ExampleGraphs.class
Normal file
BIN
out/production/ProjektGraph/graph/ExampleGraphs.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/graph/Graph.class
Normal file
BIN
out/production/ProjektGraph/graph/Graph.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/graph/MarkedEdge.class
Normal file
BIN
out/production/ProjektGraph/graph/MarkedEdge.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/graph/MarkedVertex.class
Normal file
BIN
out/production/ProjektGraph/graph/MarkedVertex.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/graph/Marking.class
Normal file
BIN
out/production/ProjektGraph/graph/Marking.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
out/production/ProjektGraph/graph/UndirectedGraph.class
Normal file
BIN
out/production/ProjektGraph/graph/UndirectedGraph.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/graph/Vertex.class
Normal file
BIN
out/production/ProjektGraph/graph/Vertex.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/graph/VertexMarking.class
Normal file
BIN
out/production/ProjektGraph/graph/VertexMarking.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/graph/VertexWeightMarking.class
Normal file
BIN
out/production/ProjektGraph/graph/VertexWeightMarking.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/graph/WrapperComparator.class
Normal file
BIN
out/production/ProjektGraph/graph/WrapperComparator.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/graph/WrapperElement.class
Normal file
BIN
out/production/ProjektGraph/graph/WrapperElement.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/logging/Algorithm.class
Normal file
BIN
out/production/ProjektGraph/logging/Algorithm.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/logging/LogElement.class
Normal file
BIN
out/production/ProjektGraph/logging/LogElement.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/logging/LogElementList.class
Normal file
BIN
out/production/ProjektGraph/logging/LogElementList.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/visualisation/DrawArea.class
Normal file
BIN
out/production/ProjektGraph/visualisation/DrawArea.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
out/production/ProjektGraph/visualisation/HybridWindow.class
Normal file
BIN
out/production/ProjektGraph/visualisation/HybridWindow.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/visualisation/LegendArea.class
Normal file
BIN
out/production/ProjektGraph/visualisation/LegendArea.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/visualisation/ParameterArea.class
Normal file
BIN
out/production/ProjektGraph/visualisation/ParameterArea.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/visualisation/TextArea.class
Normal file
BIN
out/production/ProjektGraph/visualisation/TextArea.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/visualizationElements/BarChart.class
Normal file
BIN
out/production/ProjektGraph/visualizationElements/BarChart.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
out/production/ProjektGraph/visualizationElements/Cell.class
Normal file
BIN
out/production/ProjektGraph/visualizationElements/Cell.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
out/production/ProjektGraph/visualizationElements/DotChart.class
Normal file
BIN
out/production/ProjektGraph/visualizationElements/DotChart.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/visualizationElements/Edge.class
Normal file
BIN
out/production/ProjektGraph/visualizationElements/Edge.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
out/production/ProjektGraph/visualizationElements/Graph.class
Normal file
BIN
out/production/ProjektGraph/visualizationElements/Graph.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
out/production/ProjektGraph/visualizationElements/List.class
Normal file
BIN
out/production/ProjektGraph/visualizationElements/List.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/visualizationElements/Maze.class
Normal file
BIN
out/production/ProjektGraph/visualizationElements/Maze.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/visualizationElements/Queue.class
Normal file
BIN
out/production/ProjektGraph/visualizationElements/Queue.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/visualizationElements/Stack.class
Normal file
BIN
out/production/ProjektGraph/visualizationElements/Stack.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/visualizationElements/Table.class
Normal file
BIN
out/production/ProjektGraph/visualizationElements/Table.class
Normal file
Binary file not shown.
BIN
out/production/ProjektGraph/visualizationElements/Vertex.class
Normal file
BIN
out/production/ProjektGraph/visualizationElements/Vertex.class
Normal file
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user