Created Mine Map and ReactivePlanner
This commit is contained in:
11
.idea/.idea.RobotIntelFinal/.idea/contentModel.xml
generated
11
.idea/.idea.RobotIntelFinal/.idea/contentModel.xml
generated
@@ -20,8 +20,11 @@
|
|||||||
<e p="ICell.cs" t="Include" />
|
<e p="ICell.cs" t="Include" />
|
||||||
<e p="IHexMap.cs" t="Include" />
|
<e p="IHexMap.cs" t="Include" />
|
||||||
<e p="IMapFactory.cs" t="Include" />
|
<e p="IMapFactory.cs" t="Include" />
|
||||||
|
<e p="IMineMap.cs" t="Include" />
|
||||||
<e p="ISquareMap.cs" t="Include" />
|
<e p="ISquareMap.cs" t="Include" />
|
||||||
|
<e p="MapExtensions.cs" t="Include" />
|
||||||
<e p="MapFactory.cs" t="Include" />
|
<e p="MapFactory.cs" t="Include" />
|
||||||
|
<e p="MineMap.cs" t="Include" />
|
||||||
<e p="SquareMap.cs" t="Include" />
|
<e p="SquareMap.cs" t="Include" />
|
||||||
</e>
|
</e>
|
||||||
<e p="obj" t="ExcludeRecursive">
|
<e p="obj" t="ExcludeRecursive">
|
||||||
@@ -33,18 +36,20 @@
|
|||||||
</e>
|
</e>
|
||||||
<e p="PathPlanners" t="Include">
|
<e p="PathPlanners" t="Include">
|
||||||
<e p="IPathPlanner.cs" t="Include" />
|
<e p="IPathPlanner.cs" t="Include" />
|
||||||
|
<e p="IReactivePathPlanner.cs" t="Include" />
|
||||||
<e p="PathPlanner.cs" t="Include" />
|
<e p="PathPlanner.cs" t="Include" />
|
||||||
|
<e p="ReactivePathPlanner.cs" t="Include" />
|
||||||
</e>
|
</e>
|
||||||
<e p="Program.cs" t="Include" />
|
<e p="Program.cs" t="Include" />
|
||||||
<e p="SimRunner.cs" t="Include" />
|
<e p="Sim" t="Include">
|
||||||
<e p="UserConsole.cs" t="Include" />
|
|
||||||
<e p="Vehicle" t="Include">
|
|
||||||
<e p="DetectionHead.cs" t="Include" />
|
<e p="DetectionHead.cs" t="Include" />
|
||||||
<e p="IVehicle.cs" t="Include" />
|
<e p="IVehicle.cs" t="Include" />
|
||||||
<e p="Vehicle.cs" t="Include" />
|
<e p="Vehicle.cs" t="Include" />
|
||||||
<e p="VehicleConfiguration.cs" t="Include" />
|
<e p="VehicleConfiguration.cs" t="Include" />
|
||||||
<e p="VehicleConfiguration.json" t="Include" />
|
<e p="VehicleConfiguration.json" t="Include" />
|
||||||
</e>
|
</e>
|
||||||
|
<e p="SimRunner.cs" t="Include" />
|
||||||
|
<e p="UserConsole.cs" t="Include" />
|
||||||
</e>
|
</e>
|
||||||
<e p="packages" t="ExcludeRecursive" />
|
<e p="packages" t="ExcludeRecursive" />
|
||||||
<e p="RobotIntelFinal.sln" t="IncludeFlat" />
|
<e p="RobotIntelFinal.sln" t="IncludeFlat" />
|
||||||
|
|||||||
100
.idea/.idea.RobotIntelFinal/.idea/workspace.xml
generated
100
.idea/.idea.RobotIntelFinal/.idea/workspace.xml
generated
@@ -18,23 +18,29 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="dafcaeb7-80aa-43a3-a480-786fafb78c0b" name="Default Changelist" comment="">
|
<list default="true" id="dafcaeb7-80aa-43a3-a480-786fafb78c0b" name="Default Changelist" comment="">
|
||||||
<change afterPath="$PROJECT_DIR$/ConsoleApp/Vehicle/DetectionHead.cs" afterDir="false" />
|
<change afterPath="$PROJECT_DIR$/ConsoleApp/Maps/IMineMap.cs" afterDir="false" />
|
||||||
|
<change afterPath="$PROJECT_DIR$/ConsoleApp/Maps/MapExtensions.cs" afterDir="false" />
|
||||||
|
<change afterPath="$PROJECT_DIR$/ConsoleApp/Maps/MineMap.cs" afterDir="false" />
|
||||||
|
<change afterPath="$PROJECT_DIR$/ConsoleApp/PathPlanners/IReactivePathPlanner.cs" afterDir="false" />
|
||||||
|
<change afterPath="$PROJECT_DIR$/ConsoleApp/PathPlanners/ReactivePathPlanner.cs" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.RobotIntelFinal/.idea/contentModel.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.RobotIntelFinal/.idea/contentModel.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/.idea.RobotIntelFinal/.idea/contentModel.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.RobotIntelFinal/.idea/contentModel.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.RobotIntelFinal/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.RobotIntelFinal/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/.idea.RobotIntelFinal/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.RobotIntelFinal/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ConsoleApp/ConsoleApp.csproj" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/ConsoleApp.csproj" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ConsoleApp/ConsoleApp.csproj" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/ConsoleApp.csproj" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ConsoleApp/CoreModule.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/CoreModule.cs" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ConsoleApp/CoreModule.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/CoreModule.cs" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ConsoleApp/IVehicle.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Vehicle/IVehicle.cs" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ConsoleApp/Maps/Cell.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Maps/Cell.cs" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ConsoleApp/Maps/HexMap.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Maps/HexMap.cs" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ConsoleApp/Maps/ICell.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Maps/ICell.cs" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ConsoleApp/Maps/IHexMap.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Maps/IHexMap.cs" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ConsoleApp/Maps/IMapFactory.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Maps/IMapFactory.cs" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ConsoleApp/Maps/ISquareMap.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Maps/ISquareMap.cs" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/ConsoleApp/Maps/MapFactory.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Maps/MapFactory.cs" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ConsoleApp/Maps/MapFactory.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Maps/MapFactory.cs" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ConsoleApp/Maps/SquareMap.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Maps/SquareMap.cs" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/ConsoleApp/PathPlanners/IPathPlanner.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/PathPlanners/IPathPlanner.cs" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ConsoleApp/PathPlanners/IPathPlanner.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/PathPlanners/IPathPlanner.cs" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ConsoleApp/PathPlanners/PathPlanner.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/PathPlanners/PathPlanner.cs" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ConsoleApp/PathPlanners/PathPlanner.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/PathPlanners/PathPlanner.cs" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/ConsoleApp/Program.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Program.cs" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ConsoleApp/SimRunner.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/SimRunner.cs" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ConsoleApp/SimRunner.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/SimRunner.cs" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ConsoleApp/Vehicle.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Vehicle/Vehicle.cs" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ConsoleApp/UserConsole.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/UserConsole.cs" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ConsoleApp/VehicleConfiguration.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Vehicle/VehicleConfiguration.cs" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ConsoleApp/Vehicle/DetectionHead.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Sim/DetectionHead.cs" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ConsoleApp/VehicleConfiguration.json" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Vehicle/VehicleConfiguration.json" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ConsoleApp/Vehicle/IVehicle.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Sim/IVehicle.cs" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/ConsoleApp/Vehicle/Vehicle.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Sim/Vehicle.cs" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/ConsoleApp/Vehicle/VehicleConfiguration.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Sim/VehicleConfiguration.cs" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/ConsoleApp/Vehicle/VehicleConfiguration.json" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleApp/Sim/VehicleConfiguration.json" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@@ -55,47 +61,68 @@
|
|||||||
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/EE5CA5D4-EDEB-48AE-9C0D-FE354330FB77/0b/0953c23b/GraphFactory.cs" root0="SKIP_HIGHLIGHTING" />
|
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/EE5CA5D4-EDEB-48AE-9C0D-FE354330FB77/0b/0953c23b/GraphFactory.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
|
||||||
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/EE5CA5D4-EDEB-48AE-9C0D-FE354330FB77/f7/268fdeac/Graph.cs" root0="SKIP_HIGHLIGHTING" />
|
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/EE5CA5D4-EDEB-48AE-9C0D-FE354330FB77/f7/268fdeac/Graph.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/EE5CA5D4-EDEB-48AE-9C0D-FE354330FB77/84/4eb9c798/GraphUtils.cs" root0="SKIP_HIGHLIGHTING" />
|
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/EE5CA5D4-EDEB-48AE-9C0D-FE354330FB77/84/4eb9c798/GraphUtils.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/SourcesCache/8B2EA1A3-95EB-49F7-AF97-CA55CE776F10/4/Container.cs" root0="SKIP_HIGHLIGHTING" />
|
|
||||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/SourcesCache/EB067793-5C3F-4219-AEF1-3AB117C20649/39B/EqualityComparer.CoreCLR.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/SourcesCache/EB067793-5C3F-4219-AEF1-3AB117C20649/11/Array.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/SourcesCache/EB067793-5C3F-4219-AEF1-3AB117C20649/3A4/List.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/SourcesCache/7AFCB195-1BDF-4087-9F2D-5BFCFC407B2B/30/Where.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/SourcesCache/8B2EA1A3-95EB-49F7-AF97-CA55CE776F10/4/Container.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/SourcesCache/EB067793-5C3F-4219-AEF1-3AB117C20649/389/Comparer.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/EE5CA5D4-EDEB-48AE-9C0D-FE354330FB77/3d/c367b191/Coordinate3D.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/EE5CA5D4-EDEB-48AE-9C0D-FE354330FB77/14/12025305/MovementTypes.cs" root0="SKIP_HIGHLIGHTING" />
|
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/EE5CA5D4-EDEB-48AE-9C0D-FE354330FB77/14/12025305/MovementTypes.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
|
||||||
</component>
|
</component>
|
||||||
<component name="IdeDocumentHistory">
|
<component name="IdeDocumentHistory">
|
||||||
<changedPaths>
|
<changedPaths>
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Maps/Heading.cs" />
|
<option value="$PROJECT_DIR$/ConsoleApp/Maps/Heading.cs" />
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Maps/Direction.cs" />
|
<option value="$PROJECT_DIR$/ConsoleApp/Maps/Direction.cs" />
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/CoreModule.cs" />
|
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/IPathPlanner.cs" />
|
<option value="$PROJECT_DIR$/ConsoleApp/IPathPlanner.cs" />
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/PathPlanner.cs" />
|
<option value="$PROJECT_DIR$/ConsoleApp/PathPlanner.cs" />
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Maps/GlobalDirection.cs" />
|
<option value="$PROJECT_DIR$/ConsoleApp/Maps/GlobalDirection.cs" />
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Maps/HexCoordinates.cs" />
|
<option value="$PROJECT_DIR$/ConsoleApp/Maps/HexCoordinates.cs" />
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Maps/Cell.cs" />
|
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Maps/ICell.cs" />
|
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Maps/MapFactory.cs" />
|
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Maps/IMapFactory.cs" />
|
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/IVehicle.cs" />
|
<option value="$PROJECT_DIR$/ConsoleApp/IVehicle.cs" />
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Maps/IMap.cs" />
|
<option value="$PROJECT_DIR$/ConsoleApp/Maps/IMap.cs" />
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/UserConsole.cs" />
|
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Program.cs" />
|
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Vehicle.cs" />
|
<option value="$PROJECT_DIR$/ConsoleApp/Vehicle.cs" />
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/SimRunner.cs" />
|
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/PathPlanners/IPathPlanner.cs" />
|
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Maps/IHexMap.cs" />
|
<option value="$PROJECT_DIR$/ConsoleApp/Maps/IHexMap.cs" />
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Maps/HexMap.cs" />
|
<option value="$PROJECT_DIR$/ConsoleApp/Maps/HexMap.cs" />
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Maps/SquareMap.cs" />
|
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Maps/ISquareMap.cs" />
|
<option value="$PROJECT_DIR$/ConsoleApp/Maps/ISquareMap.cs" />
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Vehicle/DetectionHead.cs" />
|
<option value="$PROJECT_DIR$/ConsoleApp/Vehicle/DetectionHead.cs" />
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Vehicle/Vehicle.cs" />
|
<option value="$PROJECT_DIR$/ConsoleApp/Vehicle/Vehicle.cs" />
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Vehicle/VehicleConfiguration.cs" />
|
<option value="$PROJECT_DIR$/ConsoleApp/Vehicle/VehicleConfiguration.cs" />
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/Vehicle/IVehicle.cs" />
|
<option value="$PROJECT_DIR$/ConsoleApp/Vehicle/IVehicle.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/Sim/DetectionHead.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/Maps/Cell.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/Maps/ICell.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/PathPlanners/IPathPlanner.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/ConsoleApp.csproj" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/Sim/Vehicle.cs" />
|
||||||
<option value="$PROJECT_DIR$/ConsoleApp/PathPlanners/PathPlanner.cs" />
|
<option value="$PROJECT_DIR$/ConsoleApp/PathPlanners/PathPlanner.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/Sim/VehicleConfiguration.json" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/CoreModule.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/UserConsole.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/Program.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/Maps/CellExtensions.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/Maps/MapExtensions.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/Maps/SquareMap.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/Maps/MineMap.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/Maps/IMineMap.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/Maps/MapFactory.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/Maps/IMapFactory.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/SimRunner.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/PathPlanners/IReactivePathPlanner.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/ConsoleApp/PathPlanners/ReactivePathPlanner.cs" />
|
||||||
</changedPaths>
|
</changedPaths>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectId" id="1lIZ7IfsUjzqV2Jb1obOFvGFAfp" />
|
<component name="ProjectId" id="1lIZ7IfsUjzqV2Jb1obOFvGFAfp" />
|
||||||
@@ -173,7 +200,7 @@
|
|||||||
<workItem from="1607982179018" duration="634000" />
|
<workItem from="1607982179018" duration="634000" />
|
||||||
<workItem from="1607983288378" duration="86000" />
|
<workItem from="1607983288378" duration="86000" />
|
||||||
<workItem from="1607983862958" duration="7777000" />
|
<workItem from="1607983862958" duration="7777000" />
|
||||||
<workItem from="1607993290571" duration="28469000" />
|
<workItem from="1607993290571" duration="36241000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
@@ -205,26 +232,39 @@
|
|||||||
<line>34</line>
|
<line>34</line>
|
||||||
<properties documentPath="$PROJECT_DIR$/ConsoleApp/PathPlanner.cs" initialLine="34" containingFunctionPresentation="method 'GenerateOptimalSquarePath'">
|
<properties documentPath="$PROJECT_DIR$/ConsoleApp/PathPlanner.cs" initialLine="34" containingFunctionPresentation="method 'GenerateOptimalSquarePath'">
|
||||||
<startOffsets>
|
<startOffsets>
|
||||||
<option value="1512" />
|
<option value="1527" />
|
||||||
</startOffsets>
|
</startOffsets>
|
||||||
<endOffsets>
|
<endOffsets>
|
||||||
<option value="1528" />
|
<option value="1543" />
|
||||||
</endOffsets>
|
</endOffsets>
|
||||||
</properties>
|
</properties>
|
||||||
<option name="timeStamp" value="24" />
|
<option name="timeStamp" value="24" />
|
||||||
</line-breakpoint>
|
</line-breakpoint>
|
||||||
<line-breakpoint enabled="true" type="DotNet Breakpoints">
|
<line-breakpoint enabled="true" type="DotNet Breakpoints">
|
||||||
<url>file://$PROJECT_DIR$/ConsoleApp/PathPlanners/PathPlanner.cs</url>
|
<url>file://$PROJECT_DIR$/ConsoleApp/PathPlanners/PathPlanner.cs</url>
|
||||||
<line>61</line>
|
<line>87</line>
|
||||||
<properties documentPath="$PROJECT_DIR$/ConsoleApp/PathPlanners/PathPlanner.cs" initialLine="62" containingFunctionPresentation="method 'GenerateOptimalHexPath'">
|
<properties documentPath="$PROJECT_DIR$/ConsoleApp/PathPlanners/PathPlanner.cs" initialLine="87" containingFunctionPresentation="method 'GenerateOptimalHexPath'">
|
||||||
<startOffsets>
|
<startOffsets>
|
||||||
<option value="2509" />
|
<option value="3651" />
|
||||||
</startOffsets>
|
</startOffsets>
|
||||||
<endOffsets>
|
<endOffsets>
|
||||||
<option value="2530" />
|
<option value="3667" />
|
||||||
</endOffsets>
|
</endOffsets>
|
||||||
</properties>
|
</properties>
|
||||||
<option name="timeStamp" value="34" />
|
<option name="timeStamp" value="44" />
|
||||||
|
</line-breakpoint>
|
||||||
|
<line-breakpoint enabled="true" type="DotNet Breakpoints">
|
||||||
|
<url>file://$PROJECT_DIR$/ConsoleApp/PathPlanners/PathPlanner.cs</url>
|
||||||
|
<line>85</line>
|
||||||
|
<properties documentPath="$PROJECT_DIR$/ConsoleApp/PathPlanners/PathPlanner.cs" initialLine="85" containingFunctionPresentation="method 'GenerateOptimalHexPath'">
|
||||||
|
<startOffsets>
|
||||||
|
<option value="3546" />
|
||||||
|
</startOffsets>
|
||||||
|
<endOffsets>
|
||||||
|
<option value="3612" />
|
||||||
|
</endOffsets>
|
||||||
|
</properties>
|
||||||
|
<option name="timeStamp" value="46" />
|
||||||
</line-breakpoint>
|
</line-breakpoint>
|
||||||
</breakpoints>
|
</breakpoints>
|
||||||
</breakpoint-manager>
|
</breakpoint-manager>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Update="Vehicle\VehicleConfiguration.json">
|
<None Update="Sim\VehicleConfiguration.json">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using System.Text.Json;
|
|
||||||
using System.Threading;
|
|
||||||
using ConsoleApp.Maps;
|
using ConsoleApp.Maps;
|
||||||
using ConsoleApp.PathPlanners;
|
using ConsoleApp.PathPlanners;
|
||||||
|
using ConsoleApp.Sim;
|
||||||
using DryIoc;
|
using DryIoc;
|
||||||
|
|
||||||
namespace ConsoleApp
|
namespace ConsoleApp
|
||||||
@@ -15,6 +14,7 @@ namespace ConsoleApp
|
|||||||
container.Register<IVehicle, Vehicle>(Reuse.Singleton);
|
container.Register<IVehicle, Vehicle>(Reuse.Singleton);
|
||||||
container.Register<IJsonDeserializor, JsonDeserializor>(Reuse.Singleton);
|
container.Register<IJsonDeserializor, JsonDeserializor>(Reuse.Singleton);
|
||||||
container.Register<IPathPlanner, PathPlanner>(Reuse.Singleton);
|
container.Register<IPathPlanner, PathPlanner>(Reuse.Singleton);
|
||||||
|
container.Register<IReactivePathPlanner, ReactivePathPlanner>(Reuse.Singleton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,16 +2,22 @@ using System;
|
|||||||
|
|
||||||
namespace ConsoleApp.Maps
|
namespace ConsoleApp.Maps
|
||||||
{
|
{
|
||||||
|
public enum Coverage
|
||||||
|
{
|
||||||
|
Uncoverd,
|
||||||
|
Covered
|
||||||
|
}
|
||||||
public struct Cell : ICell
|
public struct Cell : ICell
|
||||||
{
|
{
|
||||||
public int X { get; }
|
public int X { get; }
|
||||||
public int Y { get; }
|
public int Y { get; }
|
||||||
|
public Coverage Coverage { get; set; }
|
||||||
|
|
||||||
public Cell(int x, int y)
|
public Cell(int x, int y)
|
||||||
{
|
{
|
||||||
X = x;
|
X = x;
|
||||||
Y = y;
|
Y = y;
|
||||||
|
Coverage = Coverage.Uncoverd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,5 +4,6 @@ namespace ConsoleApp.Maps
|
|||||||
{
|
{
|
||||||
int X { get; }
|
int X { get; }
|
||||||
int Y { get; }
|
int Y { get; }
|
||||||
|
Coverage Coverage { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,8 +8,9 @@ namespace ConsoleApp.Maps
|
|||||||
int Height { get; }
|
int Height { get; }
|
||||||
int Width { get; }
|
int Width { get; }
|
||||||
int CellWidth { get; }
|
int CellWidth { get; }
|
||||||
void GenerateMaps(int x, int y);
|
void GenerateMaps(int x, int y, double minePercentage);
|
||||||
IHexMap GetHexMap();
|
IHexMap GetHexMap();
|
||||||
ISquareMap GetSquareMap();
|
ISquareMap GetSquareMap();
|
||||||
|
IMineMap GetMineMap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
7
ConsoleApp/Maps/IMineMap.cs
Normal file
7
ConsoleApp/Maps/IMineMap.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace ConsoleApp.Maps
|
||||||
|
{
|
||||||
|
public interface IMineMap
|
||||||
|
{
|
||||||
|
bool[,] Map { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
20
ConsoleApp/Maps/MapExtensions.cs
Normal file
20
ConsoleApp/Maps/MapExtensions.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
namespace ConsoleApp.Maps
|
||||||
|
{
|
||||||
|
public static class MapExtensions
|
||||||
|
{
|
||||||
|
public static void Fill2DArray<T>(this T[,] arr, T value)
|
||||||
|
{
|
||||||
|
int numRows = arr.GetLength(0);
|
||||||
|
int numCols = arr.GetLength(1);
|
||||||
|
|
||||||
|
for (int i = 0; i < numRows; ++i)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < numCols; ++j)
|
||||||
|
{
|
||||||
|
arr[i, j] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using ConsoleApp.Vehicle;
|
using ConsoleApp.Sim;
|
||||||
|
|
||||||
namespace ConsoleApp.Maps
|
namespace ConsoleApp.Maps
|
||||||
{
|
{
|
||||||
@@ -18,15 +18,19 @@ namespace ConsoleApp.Maps
|
|||||||
|
|
||||||
private IHexMap _hexMap;
|
private IHexMap _hexMap;
|
||||||
|
|
||||||
public void GenerateMaps(int x, int y)
|
private IMineMap _mineMap;
|
||||||
|
|
||||||
|
public void GenerateMaps(int x, int y, double minePercentage)
|
||||||
{
|
{
|
||||||
Width = x;
|
Width = x;
|
||||||
Height = y;
|
Height = y;
|
||||||
_squareMap = new SquareMap(x, y);
|
_squareMap = new SquareMap(x, y);
|
||||||
_hexMap = new HexMap(x, y);
|
_hexMap = new HexMap(x, y);
|
||||||
|
_mineMap = new MineMap(x, y, minePercentage);
|
||||||
}
|
}
|
||||||
public IHexMap GetHexMap() => _hexMap ?? throw new NullReferenceException("hex map not initialized");
|
public IHexMap GetHexMap() => _hexMap ?? throw new NullReferenceException("hex map not initialized");
|
||||||
public ISquareMap GetSquareMap() => _squareMap ?? throw new NullReferenceException("square map not initialized");
|
public ISquareMap GetSquareMap() => _squareMap ?? throw new NullReferenceException("square map not initialized");
|
||||||
|
public IMineMap GetMineMap() => _mineMap ?? throw new NullReferenceException("mine map not initialized");
|
||||||
|
|
||||||
public MapFactory(IVehicle vehicle)
|
public MapFactory(IVehicle vehicle)
|
||||||
{
|
{
|
||||||
|
|||||||
33
ConsoleApp/Maps/MineMap.cs
Normal file
33
ConsoleApp/Maps/MineMap.cs
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace ConsoleApp.Maps
|
||||||
|
{
|
||||||
|
public class MineMap : IMineMap
|
||||||
|
{
|
||||||
|
private int _mineCount;
|
||||||
|
private int _x;
|
||||||
|
private int _y;
|
||||||
|
public bool[,] Map { get; }
|
||||||
|
public MineMap(int x, int y, double minePercentage)
|
||||||
|
{
|
||||||
|
_x = x;
|
||||||
|
_y = y;
|
||||||
|
_mineCount = x*y*((int)minePercentage/100);
|
||||||
|
Map = new bool[x, y];
|
||||||
|
Map.Fill2DArray(false);
|
||||||
|
PlaceMines();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PlaceMines()
|
||||||
|
{
|
||||||
|
var rand = new Random();
|
||||||
|
for (int i = 0; i < _mineCount; i++)
|
||||||
|
{
|
||||||
|
var x = rand.Next(_x);
|
||||||
|
var y = rand.Next(_y);
|
||||||
|
Map[x, y] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using ConsoleApp.Maps;
|
using ConsoleApp.Maps;
|
||||||
using ConsoleApp.Vehicle;
|
using ConsoleApp.Sim;
|
||||||
|
using HexCore;
|
||||||
|
|
||||||
namespace ConsoleApp.PathPlanners
|
namespace ConsoleApp.PathPlanners
|
||||||
{
|
{
|
||||||
public interface IPathPlanner
|
public interface IPathPlanner
|
||||||
{
|
{
|
||||||
Queue<ICell> GenerateOptimalSquarePath(ISquareMap map, IVehicle vehicle);
|
Queue<ICell> GenerateOptimalSquarePath(ISquareMap map, IVehicle vehicle);
|
||||||
Queue<ICell> GenerateOptimalHexPath(IHexMap hexMap, IVehicle vehicle);
|
Queue<Coordinate2D> GenerateOptimalHexPath(IHexMap hexMap, IVehicle vehicle);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
10
ConsoleApp/PathPlanners/IReactivePathPlanner.cs
Normal file
10
ConsoleApp/PathPlanners/IReactivePathPlanner.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using HexCore;
|
||||||
|
|
||||||
|
namespace ConsoleApp.PathPlanners
|
||||||
|
{
|
||||||
|
public interface IReactivePathPlanner
|
||||||
|
{
|
||||||
|
Queue<Coordinate2D> ReactiveHexPath { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using ConsoleApp.Maps;
|
using ConsoleApp.Maps;
|
||||||
using ConsoleApp.Vehicle;
|
using ConsoleApp.Sim;
|
||||||
using HexCore;
|
using HexCore;
|
||||||
|
|
||||||
namespace ConsoleApp.PathPlanners
|
namespace ConsoleApp.PathPlanners
|
||||||
@@ -55,12 +56,76 @@ namespace ConsoleApp.PathPlanners
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Queue<ICell> GenerateOptimalHexPath(IHexMap hexMap, IVehicle vehicle)
|
public Queue<Coordinate2D> GenerateOptimalHexPath(IHexMap hexMap, IVehicle vehicle)
|
||||||
{
|
{
|
||||||
// var t = hexMap.Graph.GetMovementRange(
|
var currentPostion = vehicle.CurrentHexCell;
|
||||||
// new Coordinate2D(0, 0, hexMap.OffsetType), 2, hexMap.DefaultMovement);
|
var currentHeading = GlobalDirection.East;
|
||||||
// Console.WriteLine(t);
|
var finished = false;
|
||||||
throw new NotImplementedException();
|
var path = new List<Coordinate2D>();
|
||||||
|
while (!finished)
|
||||||
|
{
|
||||||
|
if (currentHeading == GlobalDirection.East)
|
||||||
|
{
|
||||||
|
path.AddRange(hexMap.Graph.GetShortestPath(
|
||||||
|
currentPostion,
|
||||||
|
new Coordinate2D(hexMap.Width, currentPostion.Y, hexMap.OffsetType),
|
||||||
|
hexMap.DefaultMovement));
|
||||||
|
currentPostion = new Coordinate2D(hexMap.Width, currentPostion.Y, hexMap.OffsetType);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(currentHeading == GlobalDirection.West)
|
||||||
|
{
|
||||||
|
path.AddRange(hexMap.Graph.GetShortestPath(
|
||||||
|
currentPostion,
|
||||||
|
new Coordinate2D(0, currentPostion.Y, hexMap.OffsetType),
|
||||||
|
hexMap.DefaultMovement));
|
||||||
|
currentPostion = new Coordinate2D(0, currentPostion.Y, hexMap.OffsetType);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentPostion.Y + vehicle.DetectorRadius * 2 > hexMap.Height)
|
||||||
|
{
|
||||||
|
finished = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Coordinate2D tmpPosition;
|
||||||
|
if(currentHeading == GlobalDirection.East)
|
||||||
|
tmpPosition = new Coordinate3D(
|
||||||
|
currentPostion.To3D().X-1,
|
||||||
|
currentPostion.To3D().Y,
|
||||||
|
currentPostion.To3D().Z+1).To2D(hexMap.OffsetType);
|
||||||
|
else
|
||||||
|
tmpPosition = new Coordinate3D(
|
||||||
|
currentPostion.To3D().X,
|
||||||
|
currentPostion.To3D().Y-1,
|
||||||
|
currentPostion.To3D().Z+1).To2D(hexMap.OffsetType);
|
||||||
|
while (hexMap.Graph.GetRange(currentPostion, vehicle.DetectorRadius*2).Contains(tmpPosition))
|
||||||
|
{
|
||||||
|
if(currentHeading == GlobalDirection.East)
|
||||||
|
tmpPosition = new Coordinate3D(
|
||||||
|
tmpPosition.To3D().X-1,
|
||||||
|
tmpPosition.To3D().Y,
|
||||||
|
tmpPosition.To3D().Z+1).To2D(hexMap.OffsetType);
|
||||||
|
else
|
||||||
|
tmpPosition = new Coordinate3D(
|
||||||
|
tmpPosition.To3D().X,
|
||||||
|
tmpPosition.To3D().Y-1,
|
||||||
|
tmpPosition.To3D().Z+1).To2D(hexMap.OffsetType);
|
||||||
|
}
|
||||||
|
path.AddRange(hexMap.Graph.GetShortestPath(
|
||||||
|
currentPostion,
|
||||||
|
tmpPosition,
|
||||||
|
hexMap.DefaultMovement));
|
||||||
|
currentPostion = tmpPosition;
|
||||||
|
if (currentHeading == GlobalDirection.East)
|
||||||
|
currentHeading = GlobalDirection.West;
|
||||||
|
else
|
||||||
|
currentHeading = GlobalDirection.East;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
return new Queue<Coordinate2D>(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
20
ConsoleApp/PathPlanners/ReactivePathPlanner.cs
Normal file
20
ConsoleApp/PathPlanners/ReactivePathPlanner.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using HexCore;
|
||||||
|
|
||||||
|
namespace ConsoleApp.PathPlanners
|
||||||
|
{
|
||||||
|
public class ReactivePathPlanner : IReactivePathPlanner
|
||||||
|
{
|
||||||
|
public Queue<Coordinate2D> ReactiveHexPath { get; }
|
||||||
|
|
||||||
|
public ReactivePathPlanner()
|
||||||
|
{
|
||||||
|
ReactiveHexPath = new Queue<Coordinate2D>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void GenerateReactiveHexPath(Graph graph, ref List<Coordinate3D> optimalPath, Coordinate2D minePosition)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,25 +19,26 @@ namespace ConsoleApp
|
|||||||
private static void Initialization()
|
private static void Initialization()
|
||||||
{
|
{
|
||||||
_userConsole.PrintStartMenu();
|
_userConsole.PrintStartMenu();
|
||||||
var input = _userConsole.GetUserInput();
|
var input = UserConsole.GetUserInput();
|
||||||
if (input == "1")
|
if (input == "1")
|
||||||
{
|
{
|
||||||
var (x,y) = _userConsole.GetMapDimensions();
|
var (x,y) = _userConsole.GetMapDimensions();
|
||||||
RunSimulation(x, y);
|
var minePercentage = UserConsole.GetMinePercentage();
|
||||||
|
RunSimulation(x, y, minePercentage);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_userConsole.PrintInvalidInput();
|
UserConsole.PrintInvalidInput();
|
||||||
Initialization();
|
Initialization();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void RunSimulation(int x,int y)
|
private static void RunSimulation(int x, int y, double minePercentage)
|
||||||
{
|
{
|
||||||
var mapFactory = _bootstrapper.Resolve<IMapFactory>();
|
var mapFactory = _bootstrapper.Resolve<IMapFactory>();
|
||||||
var simRunner = _bootstrapper.Resolve<ISimRunner>();
|
var simRunner = _bootstrapper.Resolve<ISimRunner>();
|
||||||
|
|
||||||
mapFactory.GenerateMaps(x, y);
|
mapFactory.GenerateMaps(x, y, minePercentage);
|
||||||
simRunner.Run();
|
simRunner.Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,17 @@ using System.Collections.Generic;
|
|||||||
using ConsoleApp.Maps;
|
using ConsoleApp.Maps;
|
||||||
using HexCore;
|
using HexCore;
|
||||||
|
|
||||||
namespace ConsoleApp.Vehicle
|
namespace ConsoleApp.Sim
|
||||||
{
|
{
|
||||||
public class DetectionHead
|
public static class DetectionHead
|
||||||
{
|
{
|
||||||
public List<Coordinate2D> GetCoveredCells(
|
public static List<Coordinate2D> GetCoveredCells(
|
||||||
Graph graph,
|
Graph graph,
|
||||||
Coordinate2D centerCoordinate,
|
Coordinate2D centerCoordinate,
|
||||||
int detectorRadius,
|
int detectorRadius,
|
||||||
GlobalDirection direction) => graph.GetRange(centerCoordinate, detectorRadius);
|
GlobalDirection direction) => graph.GetRange(centerCoordinate, detectorRadius);
|
||||||
|
|
||||||
public List<Cell> GetCoveredCells(
|
public static List<Cell> GetCoveredCells(
|
||||||
ISquareMap squareMap,
|
ISquareMap squareMap,
|
||||||
Cell centerCell,
|
Cell centerCell,
|
||||||
int detectorRadius) => squareMap.GetRange(centerCell, detectorRadius);
|
int detectorRadius) => squareMap.GetRange(centerCell, detectorRadius);
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using ConsoleApp.Maps;
|
using ConsoleApp.Maps;
|
||||||
|
|
||||||
namespace ConsoleApp.Vehicle
|
namespace ConsoleApp.Sim
|
||||||
{
|
{
|
||||||
public interface IVehicle
|
public interface IVehicle
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using ConsoleApp.Maps;
|
using ConsoleApp.Maps;
|
||||||
|
|
||||||
namespace ConsoleApp.Vehicle
|
namespace ConsoleApp.Sim
|
||||||
{
|
{
|
||||||
public class Vehicle : IVehicle
|
public class Vehicle : IVehicle
|
||||||
{
|
{
|
||||||
@@ -13,20 +13,19 @@ namespace ConsoleApp.Vehicle
|
|||||||
public Heading HexHeading { get; set; }
|
public Heading HexHeading { get; set; }
|
||||||
public Heading SquareHeading { get; set; }
|
public Heading SquareHeading { get; set; }
|
||||||
public ICell CurrentSquareCell { get; set; }
|
public ICell CurrentSquareCell { get; set; }
|
||||||
public DetectionHead DetectionHead { get; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Vehicle(IJsonDeserializor jsonDeserializor)
|
public Vehicle(IJsonDeserializor jsonDeserializor)
|
||||||
{
|
{
|
||||||
var config = jsonDeserializor.DeserializeObject<VehicleConfiguration>("/Users/brady.bodily/Documents/Repositories/CS5890_Robot_Intelligence/RobotIntelFinal/ConsoleApp/Vehicle/VehicleConfiguration.json");
|
var config = jsonDeserializor.DeserializeObject<VehicleConfiguration>("/Users/brady.bodily/Documents/Repositories/CS5890_Robot_Intelligence/RobotIntelFinal/ConsoleApp/Sim/VehicleConfiguration.json");
|
||||||
Length = config.Length;
|
Length = config.Length;
|
||||||
Width = config.Width;
|
Width = config.Width;
|
||||||
DetectorRadius = config.DetectorRadius;
|
DetectorRadius = config.DetectorRadius;
|
||||||
DetectorOffset = config.DetectorOffset;
|
DetectorOffset = config.DetectorOffset;
|
||||||
CurrentHexCell = default;
|
CurrentHexCell = default;
|
||||||
CurrentSquareCell = default;
|
CurrentSquareCell = default;
|
||||||
DetectionHead = new DetectionHead();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace ConsoleApp.Vehicle
|
namespace ConsoleApp.Sim
|
||||||
{
|
{
|
||||||
public class VehicleConfiguration
|
public class VehicleConfiguration
|
||||||
{
|
{
|
||||||
6
ConsoleApp/Sim/VehicleConfiguration.json
Normal file
6
ConsoleApp/Sim/VehicleConfiguration.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"Length": 3,
|
||||||
|
"Width": 2,
|
||||||
|
"DetectorRadius": 3,
|
||||||
|
"DetectorOffset": 2
|
||||||
|
}
|
||||||
@@ -4,7 +4,7 @@ using System.Threading;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using ConsoleApp.Maps;
|
using ConsoleApp.Maps;
|
||||||
using ConsoleApp.PathPlanners;
|
using ConsoleApp.PathPlanners;
|
||||||
using ConsoleApp.Vehicle;
|
using ConsoleApp.Sim;
|
||||||
using HexCore;
|
using HexCore;
|
||||||
|
|
||||||
namespace ConsoleApp
|
namespace ConsoleApp
|
||||||
@@ -16,20 +16,23 @@ namespace ConsoleApp
|
|||||||
|
|
||||||
private int _cellWidth;
|
private int _cellWidth;
|
||||||
private IPathPlanner _pathPlanner;
|
private IPathPlanner _pathPlanner;
|
||||||
|
private IMineMap _mineMap;
|
||||||
|
private IReactivePathPlanner _reactivePathPlanner;
|
||||||
|
|
||||||
|
|
||||||
public SimRunner(IMapFactory mapFactory, IVehicle vehicle, IPathPlanner pathPlanner)
|
public SimRunner(IMapFactory mapFactory, IVehicle vehicle, IPathPlanner pathPlanner, IReactivePathPlanner reactivePathPlanner)
|
||||||
{
|
{
|
||||||
|
|
||||||
_cellWidth = mapFactory.CellWidth;
|
_cellWidth = mapFactory.CellWidth;
|
||||||
_mapFactory = mapFactory;
|
_mapFactory = mapFactory;
|
||||||
_vehicle = vehicle;
|
_vehicle = vehicle;
|
||||||
_pathPlanner = pathPlanner;
|
_pathPlanner = pathPlanner;
|
||||||
|
_reactivePathPlanner = reactivePathPlanner;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Run()
|
public void Run()
|
||||||
{
|
{
|
||||||
|
_mineMap = _mapFactory.GetMineMap();
|
||||||
SquareSimulation();
|
SquareSimulation();
|
||||||
HexSimulation();
|
HexSimulation();
|
||||||
// while(!squareTask.IsCompleted && !hexTask.IsCompleted){Thread.Sleep(500);}
|
// while(!squareTask.IsCompleted && !hexTask.IsCompleted){Thread.Sleep(500);}
|
||||||
@@ -41,6 +44,7 @@ namespace ConsoleApp
|
|||||||
var hexMap = _mapFactory.GetHexMap();
|
var hexMap = _mapFactory.GetHexMap();
|
||||||
_vehicle.CurrentHexCell = new Coordinate2D(0, 0, OffsetTypes.OddRowsRight);
|
_vehicle.CurrentHexCell = new Coordinate2D(0, 0, OffsetTypes.OddRowsRight);
|
||||||
var optimalPath = _pathPlanner.GenerateOptimalHexPath(hexMap, _vehicle);
|
var optimalPath = _pathPlanner.GenerateOptimalHexPath(hexMap, _vehicle);
|
||||||
|
var reactivePath = _reactivePathPlanner.ReactiveHexPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,14 +18,11 @@ namespace ConsoleApp
|
|||||||
$"\t 2: Load custom map. \n");
|
$"\t 2: Load custom map. \n");
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetUserInput() => Console.ReadLine();
|
public static string GetUserInput() => Console.ReadLine();
|
||||||
|
|
||||||
public void PrintInvalidInput()
|
public static void PrintInvalidInput() => Console.WriteLine($"Invalid input try again \n");
|
||||||
{
|
|
||||||
Console.WriteLine($"Invalid input try again \n");
|
|
||||||
}
|
|
||||||
|
|
||||||
public (int width, int height) GetMapDimensions()
|
public (int width, int height) GetMapDimensions()
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Enter map height: ");
|
Console.WriteLine($"Enter map height: ");
|
||||||
var x = GetUserInput();
|
var x = GetUserInput();
|
||||||
@@ -38,12 +35,23 @@ namespace ConsoleApp
|
|||||||
|
|
||||||
Console.WriteLine($"Enter map height: ");
|
Console.WriteLine($"Enter map height: ");
|
||||||
var y = GetUserInput();
|
var y = GetUserInput();
|
||||||
if(!int.TryParse(y, out var height))
|
if (int.TryParse(y, out var height)) return (width, height);
|
||||||
{
|
PrintInvalidInput();
|
||||||
PrintInvalidInput();
|
GetMapDimensions();
|
||||||
GetMapDimensions();
|
|
||||||
}
|
|
||||||
return (width, height);
|
return (width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static double GetMinePercentage()
|
||||||
|
{
|
||||||
|
|
||||||
|
Console.WriteLine($"Enter desired percentage of mines: ");
|
||||||
|
var x = GetUserInput();
|
||||||
|
|
||||||
|
if (double.TryParse(x, out var percent)) return percent;
|
||||||
|
PrintInvalidInput();
|
||||||
|
GetMinePercentage();
|
||||||
|
|
||||||
|
return percent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"Length": 3,
|
|
||||||
"Width": 2,
|
|
||||||
"DetectorWidth": 3,
|
|
||||||
"DetectorOffset": 1
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user