Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
artificial-intelligence
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jak.moore
artificial-intelligence
Commits
70e39fec
Commit
70e39fec
authored
Mar 15, 2018
by
jak.moore
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
node
parent
e25aa278
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
180 additions
and
59 deletions
+180
-59
workspace.xml
.idea/workspace.xml
+124
-46
Actions.java
src/Actions.java
+1
-1
Main.java
src/Main.java
+38
-12
Node.java
src/Node.java
+17
-0
No files found.
.idea/workspace.xml
View file @
70e39fec
...
@@ -2,7 +2,10 @@
...
@@ -2,7 +2,10 @@
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"877516c2-7542-40e5-94ff-ae7978c8b639"
name=
"Default"
comment=
""
>
<list
default=
"true"
id=
"877516c2-7542-40e5-94ff-ae7978c8b639"
name=
"Default"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/vcs.xml"
afterPath=
"$PROJECT_DIR$/.idea/vcs.xml"
/>
<change
beforePath=
""
afterPath=
"$PROJECT_DIR$/src/Node.java"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
/>
<change
beforePath=
"$PROJECT_DIR$/src/Actions.java"
afterPath=
"$PROJECT_DIR$/src/Actions.java"
/>
<change
beforePath=
"$PROJECT_DIR$/src/Main.java"
afterPath=
"$PROJECT_DIR$/src/Main.java"
/>
</list>
</list>
<ignored
path=
"$PROJECT_DIR$/out/"
/>
<ignored
path=
"$PROJECT_DIR$/out/"
/>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
...
@@ -13,12 +16,22 @@
...
@@ -13,12 +16,22 @@
<option
name=
"LAST_RESOLUTION"
value=
"IGNORE"
/>
<option
name=
"LAST_RESOLUTION"
value=
"IGNORE"
/>
</component>
</component>
<component
name=
"FileEditorManager"
>
<component
name=
"FileEditorManager"
>
<leaf>
<leaf
SIDE_TABS_SIZE_LIMIT_KEY=
"300"
>
<file
leaf-file-name=
"
Actions
.java"
pinned=
"false"
current-in-tab=
"false"
>
<file
leaf-file-name=
"
Main
.java"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/src/
Actions
.java"
>
<entry
file=
"file://$PROJECT_DIR$/src/
Main
.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"18"
>
<state
relative-caret-position=
"382"
>
<caret
line=
"1"
column=
"12"
lean-forward=
"false"
selection-start-line=
"1"
selection-start-column=
"12"
selection-end-line=
"1"
selection-end-column=
"12"
/>
<caret
line=
"288"
column=
"62"
lean-forward=
"true"
selection-start-line=
"288"
selection-start-column=
"62"
selection-end-line=
"288"
selection-end-column=
"62"
/>
<folding
/>
</state>
</provider>
</entry>
</file>
<file
leaf-file-name=
"Node.java"
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/src/Node.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"108"
>
<caret
line=
"6"
column=
"21"
lean-forward=
"false"
selection-start-line=
"6"
selection-start-column=
"21"
selection-end-line=
"6"
selection-end-column=
"21"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
...
@@ -27,18 +40,20 @@
...
@@ -27,18 +40,20 @@
<file
leaf-file-name=
"GameState.java"
pinned=
"false"
current-in-tab=
"false"
>
<file
leaf-file-name=
"GameState.java"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/src/GameState.java"
>
<entry
file=
"file://$PROJECT_DIR$/src/GameState.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"54"
>
<state
relative-caret-position=
"552"
>
<caret
line=
"3"
column=
"13"
lean-forward=
"false"
selection-start-line=
"3"
selection-start-column=
"13"
selection-end-line=
"3"
selection-end-column=
"13"
/>
<caret
line=
"40"
column=
"1"
lean-forward=
"true"
selection-start-line=
"21"
selection-start-column=
"3"
selection-end-line=
"40"
selection-end-column=
"1"
/>
<folding
/>
<folding>
<element
signature=
"e#595#625#0"
expanded=
"true"
/>
</folding>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
</file>
</file>
<file
leaf-file-name=
"
Main.java"
pinned=
"false"
current-in-tab=
"tru
e"
>
<file
leaf-file-name=
"
Actions.java"
pinned=
"false"
current-in-tab=
"fals
e"
>
<entry
file=
"file://$PROJECT_DIR$/src/
Main
.java"
>
<entry
file=
"file://$PROJECT_DIR$/src/
Actions
.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
36
"
>
<state
relative-caret-position=
"
187
"
>
<caret
line=
"
2"
column=
"13"
lean-forward=
"false"
selection-start-line=
"2"
selection-start-column=
"13"
selection-end-line=
"2"
selection-end-column=
"13
"
/>
<caret
line=
"
11"
column=
"0"
lean-forward=
"true"
selection-start-line=
"11"
selection-start-column=
"0"
selection-end-line=
"11"
selection-end-column=
"0
"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
...
@@ -46,6 +61,13 @@
...
@@ -46,6 +61,13 @@
</file>
</file>
</leaf>
</leaf>
</component>
</component>
<component
name=
"FileTemplateManagerImpl"
>
<option
name=
"RECENT_TEMPLATES"
>
<list>
<option
value=
"Class"
/>
</list>
</option>
</component>
<component
name=
"Git.Settings"
>
<component
name=
"Git.Settings"
>
<option
name=
"RECENT_GIT_ROOT_PATH"
value=
"$PROJECT_DIR$"
/>
<option
name=
"RECENT_GIT_ROOT_PATH"
value=
"$PROJECT_DIR$"
/>
</component>
</component>
...
@@ -54,11 +76,20 @@
...
@@ -54,11 +76,20 @@
<projects_view
/>
<projects_view
/>
</option>
</option>
</component>
</component>
<component
name=
"IdeDocumentHistory"
>
<option
name=
"CHANGED_PATHS"
>
<list>
<option
value=
"$PROJECT_DIR$/src/Actions.java"
/>
<option
value=
"$PROJECT_DIR$/src/Node.java"
/>
<option
value=
"$PROJECT_DIR$/src/Main.java"
/>
</list>
</option>
</component>
<component
name=
"ProjectFrameBounds"
extendedState=
"6"
>
<component
name=
"ProjectFrameBounds"
extendedState=
"6"
>
<option
name=
"x"
value=
"
186
"
/>
<option
name=
"x"
value=
"
260
"
/>
<option
name=
"y"
value=
"
45
"
/>
<option
name=
"y"
value=
"
118
"
/>
<option
name=
"width"
value=
"13
9
0"
/>
<option
name=
"width"
value=
"13
8
0"
/>
<option
name=
"height"
value=
"10
07
"
/>
<option
name=
"height"
value=
"10
14
"
/>
</component>
</component>
<component
name=
"ProjectView"
>
<component
name=
"ProjectView"
>
<navigator
currentView=
"ProjectPane"
proportions=
""
version=
"1"
>
<navigator
currentView=
"ProjectPane"
proportions=
""
version=
"1"
>
...
@@ -76,6 +107,8 @@
...
@@ -76,6 +107,8 @@
</navigator>
</navigator>
<panes>
<panes>
<pane
id=
"Scope"
/>
<pane
id=
"Scope"
/>
<pane
id=
"PackagesPane"
/>
<pane
id=
"Scratches"
/>
<pane
id=
"AndroidView"
/>
<pane
id=
"AndroidView"
/>
<pane
id=
"ProjectPane"
>
<pane
id=
"ProjectPane"
>
<subPane>
<subPane>
...
@@ -93,10 +126,11 @@
...
@@ -93,10 +126,11 @@
<select
/>
<select
/>
</subPane>
</subPane>
</pane>
</pane>
<pane
id=
"Scratches"
/>
<pane
id=
"PackagesPane"
/>
</panes>
</panes>
</component>
</component>
<component
name=
"PropertiesComponent"
>
<property
name=
"settings.editor.selected.configurable"
value=
"preferences.editor"
/>
</component>
<component
name=
"RunDashboard"
>
<component
name=
"RunDashboard"
>
<option
name=
"ruleStates"
>
<option
name=
"ruleStates"
>
<list>
<list>
...
@@ -208,35 +242,43 @@
...
@@ -208,35 +242,43 @@
</task>
</task>
<servers
/>
<servers
/>
</component>
</component>
<component
name=
"TodoView"
>
<todo-panel
id=
"selected-file"
>
<is-autoscroll-to-source
value=
"true"
/>
</todo-panel>
<todo-panel
id=
"all"
>
<are-packages-shown
value=
"true"
/>
<is-autoscroll-to-source
value=
"true"
/>
</todo-panel>
</component>
<component
name=
"ToolWindowManager"
>
<component
name=
"ToolWindowManager"
>
<frame
x=
"0"
y=
"27"
width=
"1920"
height=
"1053"
extended-state=
"6"
/>
<frame
x=
"0"
y=
"27"
width=
"1920"
height=
"1053"
extended-state=
"6"
/>
<editor
active=
"true"
/>
<layout>
<layout>
<window_info
id=
"Palette"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"
-1
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Palette"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"
0
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"TODO"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.3
3"
sideWeight=
"0.5"
order=
"6
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"TODO"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.3
2967034"
sideWeight=
"0.49786323"
order=
"7
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Palette	"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"
-
1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Palette	"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Image Layers"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"
-1
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Image Layers"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"
0
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Capture Analysis"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"
-1
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Capture Analysis"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"
2
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Event Log"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"
false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"-1"
side_tool=
"tru
e"
content_ui=
"tabs"
/>
<window_info
id=
"Event Log"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"
true"
show_stripe_button=
"true"
weight=
"0.50769234"
sideWeight=
"0.5032051"
order=
"9"
side_tool=
"fals
e"
content_ui=
"tabs"
/>
<window_info
id=
"Maven Projects"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"
-1
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Maven Projects"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"
4
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"
Version Control"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"-1
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"
Run"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"
Run"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"2
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"
Version Control"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.21758242"
sideWeight=
"0.49786323"
order=
"0
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Terminal"
active=
"
false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"-1"
side_tool=
"fals
e"
content_ui=
"tabs"
/>
<window_info
id=
"Terminal"
active=
"
true"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
show_stripe_button=
"true"
weight=
"0.50769234"
sideWeight=
"0.49679488"
order=
"8"
side_tool=
"tru
e"
content_ui=
"tabs"
/>
<window_info
id=
"Capture Tool"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"
-
1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Capture Tool"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Designer"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"
-1
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Designer"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"
2
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Project"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
show_stripe_button=
"true"
weight=
"0.
25"
sideWeight=
"0.5"
order=
"0
"
side_tool=
"false"
content_ui=
"combo"
/>
<window_info
id=
"Project"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
show_stripe_button=
"true"
weight=
"0.
13087606"
sideWeight=
"0.5"
order=
"5
"
side_tool=
"false"
content_ui=
"combo"
/>
<window_info
id=
"
Structure"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"1
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"
Find"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"2
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"
Ant Build"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"1
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"
Structure"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
show_stripe_button=
"true"
weight=
"0.12339743"
sideWeight=
"0.5"
order=
"3
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"
UI Designer"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"-1
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"
Ant Build"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"7
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"
Theme Preview"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"-1
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"
UI Designer"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"
Favorites"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"-1"
side_tool=
"tru
e"
content_ui=
"tabs"
/>
<window_info
id=
"
Theme Preview"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"5"
side_tool=
"fals
e"
content_ui=
"tabs"
/>
<window_info
id=
"Debug"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.4"
sideWeight=
"0.5"
order=
"
3
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Debug"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.4"
sideWeight=
"0.5"
order=
"
4
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"
Cvs"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"4"
side_tool=
"fals
e"
content_ui=
"tabs"
/>
<window_info
id=
"
Favorites"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"4"
side_tool=
"tru
e"
content_ui=
"tabs"
/>
<window_info
id=
"
Hierarchy"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"2"
side_tool=
"false"
content_ui=
"combo
"
/>
<window_info
id=
"
Cvs"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"5"
side_tool=
"false"
content_ui=
"tabs
"
/>
<window_info
id=
"Message"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"
0
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Message"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"
1
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Commander"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.4"
sideWeight=
"0.5"
order=
"
0
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Commander"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.4"
sideWeight=
"0.5"
order=
"
6
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"
Find"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"1"
side_tool=
"false"
content_ui=
"tabs
"
/>
<window_info
id=
"
Hierarchy"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"8"
side_tool=
"false"
content_ui=
"combo
"
/>
<window_info
id=
"Inspection"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.4"
sideWeight=
"0.5"
order=
"
5
"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Inspection"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.4"
sideWeight=
"0.5"
order=
"
6
"
side_tool=
"false"
content_ui=
"tabs"
/>
</layout>
</layout>
</component>
</component>
<component
name=
"VcsContentAnnotationSettings"
>
<component
name=
"VcsContentAnnotationSettings"
>
...
@@ -259,7 +301,9 @@
...
@@ -259,7 +301,9 @@
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"54"
>
<state
relative-caret-position=
"54"
>
<caret
line=
"3"
column=
"13"
lean-forward=
"false"
selection-start-line=
"3"
selection-start-column=
"13"
selection-end-line=
"3"
selection-end-column=
"13"
/>
<caret
line=
"3"
column=
"13"
lean-forward=
"false"
selection-start-line=
"3"
selection-start-column=
"13"
selection-end-line=
"3"
selection-end-column=
"13"
/>
<folding
/>
<folding>
<element
signature=
"e#595#625#0"
expanded=
"true"
/>
</folding>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
...
@@ -271,6 +315,40 @@
...
@@ -271,6 +315,40 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/Actions.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"187"
>
<caret
line=
"11"
column=
"0"
lean-forward=
"true"
selection-start-line=
"11"
selection-start-column=
"0"
selection-end-line=
"11"
selection-end-column=
"0"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/GameState.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"552"
>
<caret
line=
"40"
column=
"1"
lean-forward=
"true"
selection-start-line=
"21"
selection-start-column=
"3"
selection-end-line=
"40"
selection-end-column=
"1"
/>
<folding>
<element
signature=
"e#595#625#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/Main.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"382"
>
<caret
line=
"288"
column=
"62"
lean-forward=
"true"
selection-start-line=
"288"
selection-start-column=
"62"
selection-end-line=
"288"
selection-end-column=
"62"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/Node.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"108"
>
<caret
line=
"6"
column=
"21"
lean-forward=
"false"
selection-start-line=
"6"
selection-start-column=
"21"
selection-end-line=
"6"
selection-end-column=
"21"
/>
<folding
/>
</state>
</provider>
</entry>
</component>
</component>
<component
name=
"masterDetails"
>
<component
name=
"masterDetails"
>
<states>
<states>
...
...
src/Actions.java
View file @
70e39fec
...
@@ -6,6 +6,6 @@ public enum Actions {
...
@@ -6,6 +6,6 @@ public enum Actions {
WOLF_LEFT_TO_BOAT
,
WOLF_RIGHT_TO_BOAT
,
WOLF_LEFT_TO_BOAT
,
WOLF_RIGHT_TO_BOAT
,
WOLF_BOAT_TO_LEFT
,
WOLF_BOAT_TO_RIGHT
,
WOLF_BOAT_TO_LEFT
,
WOLF_BOAT_TO_RIGHT
,
CHICKEN_RIGHT_TO_BOAT
,
CHICKEN_LEFT_TO_BOAT
,
CHICKEN_RIGHT_TO_BOAT
,
CHICKEN_LEFT_TO_BOAT
,
CHICKEN_BOAT_TO_RIGHT
,
CHICKEN_BOAT_TO_LEFT
,
CHICKEN_BOAT_TO_RIGHT
,
CHICKEN_BOAT_TO_LEFT
,
VOID
}
}
src/Main.java
View file @
70e39fec
...
@@ -2,7 +2,7 @@ import java.util.ArrayList;
...
@@ -2,7 +2,7 @@ import java.util.ArrayList;
public
class
Main
{
public
class
Main
{
private
boolean
planCompleted
=
false
;
private
static
boolean
planCompleted
=
false
;
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
@@ -17,19 +17,40 @@ public class Main {
...
@@ -17,19 +17,40 @@ public class Main {
// Instantiating a new Game State object
// Instantiating a new Game State object
GameState
gs
=
new
GameState
(
lBank
,
rBank
,
raft
,
true
);
GameState
gs
=
new
GameState
(
lBank
,
rBank
,
raft
,
true
);
//
Invoking get actions method and storing the results in an array
list
//
Closed
list
ArrayList
<
Actions
>
validActions
=
getActions
(
gs
);
ArrayList
<
GameState
>
closedList
=
new
ArrayList
(
);
// Array list to hold game states
// Array list to hold game states
ArrayList
<
GameState
>
newStates
=
new
ArrayList
();
ArrayList
<
Node
>
frontier
=
new
ArrayList
();
frontier
.
add
(
new
Node
(
Actions
.
VOID
,
gs
));
// Iterate through valid actions simulating their game state
while
(
true
)
{
for
(
Actions
a
:
validActions
)
{
gs
=
Simulate
(
gs
,
a
);
Node
firstNode
=
frontier
.
get
(
0
);
// Storing possible game states in array list
if
(
goalTest
(
firstNode
.
gs
))
{
newStates
.
add
(
gs
);
System
.
out
.
print
(
"COMPLETE"
);
planCompleted
=
true
;
}
ArrayList
<
Actions
>
validActions
=
getActions
(
firstNode
.
gs
);
// Iterate through valid actions simulating their game state
for
(
Actions
a
:
validActions
)
{
gs
=
Simulate
(
firstNode
.
gs
,
a
);
if
(!
closedList
.
contains
(
gs
))
{
// Storing possible game states in frontier
frontier
.
add
(
new
Node
(
a
,
gs
));
}
}
closedList
.
add
(
firstNode
.
gs
);
}
}
...
@@ -39,7 +60,7 @@ public class Main {
...
@@ -39,7 +60,7 @@ public class Main {
private
static
ArrayList
<
Actions
>
getActions
(
GameState
gs
)
{
private
static
ArrayList
<
Actions
>
getActions
(
GameState
gs
)
{
// Array list to hold possible actions
// Array list to hold possible actions
ArrayList
<
Actions
>
possibleActions
=
new
ArrayList
<>
();
ArrayList
<
Actions
>
possibleActions
=
new
ArrayList
();
// Counters to hold game information
// Counters to hold game information
int
wolvesOnLBank
=
0
;
int
wolvesOnLBank
=
0
;
...
@@ -53,7 +74,9 @@ public class Main {
...
@@ -53,7 +74,9 @@ public class Main {
// Getting current state of game
// Getting current state of game
if
(
gs
.
raft
.
size
()
>
1
)
{
if
(
gs
.
raft
.
size
()
>
1
)
{
raftFull
=
true
;
raftFull
=
true
;
}
}
for
(
int
i
:
gs
.
leftBank
)
{
for
(
int
i
:
gs
.
leftBank
)
{
...
@@ -238,10 +261,11 @@ public class Main {
...
@@ -238,10 +261,11 @@ public class Main {
}
}
return
gs
;
return
gs
;
}
}
// Goal test method
// Goal test method
public
boolean
goalTest
(
GameState
gs
)
{
public
static
boolean
goalTest
(
GameState
gs
)
{
int
lengthR
=
gs
.
rightBank
.
size
();
int
lengthR
=
gs
.
rightBank
.
size
();
int
lengthL
=
gs
.
leftBank
.
size
();
int
lengthL
=
gs
.
leftBank
.
size
();
...
@@ -293,7 +317,7 @@ public class Main {
...
@@ -293,7 +317,7 @@ public class Main {
}
}
// Check final counts
// Check final counts
private
boolean
completed
(
int
wolves
,
int
chickens
)
{
private
static
boolean
completed
(
int
wolves
,
int
chickens
)
{
if
((
wolves
==
3
)
&&
(
chickens
==
3
))
{
if
((
wolves
==
3
)
&&
(
chickens
==
3
))
{
...
@@ -303,7 +327,9 @@ public class Main {
...
@@ -303,7 +327,9 @@ public class Main {
}
else
{
}
else
{
return
false
;
return
false
;
}
}
}
}
}
}
src/Node.java
0 → 100644
View file @
70e39fec
public
class
Node
{
Node
parent
;
GameState
gs
;
public
Node
(
Actions
actionTaken
,
GameState
gs
)
{
this
.
gs
=
gs
;
}
public
void
setParent
(
Node
parent
)
{
this
.
parent
=
parent
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment