Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Mesterseges Intelligencia HF01
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Cseh Viktor
Mesterseges Intelligencia HF01
Commits
314768be
Commit
314768be
authored
3 years ago
by
Cseh Viktor
Browse files
Options
Downloads
Patches
Plain Diff
Mokudik nem rekurzivan, de nem eleg gyors az mi hazihoz...
parent
175fd672
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
GG2DP5_hf01.zip
+0
-0
0 additions, 0 deletions
GG2DP5_hf01.zip
input4
+1
-1
1 addition, 1 deletion
input4
mi_GG2DP5_hf1.py
+14
-28
14 additions, 28 deletions
mi_GG2DP5_hf1.py
with
15 additions
and
29 deletions
GG2DP5_hf01.zip
+
0
−
0
View file @
314768be
No preview for this file type
This diff is collapsed.
Click to expand it.
input4
+
1
−
1
View file @
314768be
This diff is collapsed.
Click to expand it.
mi_GG2DP5_hf1.py
+
14
−
28
View file @
314768be
...
...
@@ -52,29 +52,6 @@ def dijkstra(a, b):
if
(
length
+
distance
[
a
]
<
distance
[
route_between_points
[
i
]]):
distance
[
route_between_points
[
i
]]
=
length
+
distance
[
a
]
minimum_distance
=
math
.
inf
corresponding_point
=
None
cntr
=
0
i
=
0
#print("*** debug: " + str(len(seen)), file=sys.stderr)
for
i
in
range
(
0
,
len
(
seen
),
1
):
#print("*** debug: " + str(distance[i]), file=sys.stderr)
#print("*** debug: " + str(seen[i]), file=sys.stderr)
#print("*** /debug ******* ", file=sys.stderr)
if
(
seen
[
i
]
==
0
and
(
distance
[
i
]
!=
None
)):
#Meghivni ra a dijkstra algoritmust rekurzivan, ha mar szamoltuk, de ne jartunk meg benne
cntr
+=
1
#print("*** debug: talalt pontot amiben meg nem volt", file=sys.stderr)
if
(
distance
[
i
]
<
minimum_distance
):
# Es legkisebb a tavolsaga eddig
minimum_distance
=
distance
[
i
]
corresponding_point
=
i
if
(
cntr
>
0
):
dijkstra
(
corresponding_point
,
b
)
def
route_search
():
asd
=
len
(
point_coordinates
)
asd
=
asd
/
2
...
...
@@ -90,15 +67,24 @@ def route_search():
for
i
in
range
(
asd
):
seen
.
append
(
0
)
#print("**** debug: " + str(distance), file=sys.stderr)
#print("**** debug: " + str(seen), file=sys.stderr)
for
y
in
range
(
map_config
[
1
]):
minimum_distance
=
math
.
inf
corresponding_point
=
None
cntr
=
0
i
=
0
for
i
in
range
(
0
,
len
(
seen
),
1
):
if
(
seen
[
i
]
==
0
and
(
distance
[
i
]
!=
None
)):
#Meghivni ra a dijkstra algoritmust rekurzivan, ha mar szamoltuk, de ne jartunk meg benne
cntr
+=
1
if
(
distance
[
i
]
<
minimum_distance
):
# Es legkisebb a tavolsaga eddig
minimum_distance
=
distance
[
i
]
corresponding_point
=
i
dijkstra
(
route_to_calc
[
x
],
route_to_calc
[
x
+
1
])
if
(
cntr
>
0
):
dijkstra
(
corresponding_point
,
route_to_calc
[
x
+
1
])
distance
.
clear
()
seen
.
clear
()
def
calc_route_length
(
a
,
b
):
# X koordinata lekerese es szamolasa a pitagorasz tetelhez
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment