Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tanmim Hanifa
GameAICW2
Commits
8424551b
Commit
8424551b
authored
Nov 17, 2017
by
Tanmim Hanifa
Browse files
final commit
parent
5133693a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Greedy.cs
View file @
8424551b
...
...
@@ -10,7 +10,7 @@ public class Greedy : Pathfinder {
private
PriorityQueue
frontier
;
private
Dictionary
<
Node
,
Node
>
previous
;
private
Dictionary
<
Node
,
int
>
cost
;
private
Dictionary
<
Node
,
Node
>
visitedFrom
;
private
Dictionary
<
Node
,
int
>
visitedFrom
;
public
void
SetGraph
(
Graph
g
)
{
graph
=
g
;
...
...
@@ -54,9 +54,9 @@ public class Greedy : Pathfinder {
bool
found
=
false
;
Node
start
;
visitedFrom
=
new
Dictionary
<
Node
,
Node
>();
visitedFrom
=
new
Dictionary
<
Node
,
int
>();
frontier
.
Enqueue
(
start
,
0
);
visitedFrom
[
start
];
visitedFrom
[
start
]
=
-
1
;
while
(
frontier
.
Count
>
0
){
Node
current
=
frontier
.
Dequeue
();
...
...
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