home
·
contact
·
privacy
projects
/
plomrogue2
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
722f6c3
)
Record ideas for optimizing Dijkstra mapping.
author
Christian Heller
<c.heller@plomlompom.de>
Sun, 6 Dec 2020 19:16:55 +0000
(20:16 +0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Sun, 6 Dec 2020 19:16:55 +0000
(20:16 +0100)
plomrogue/mapping.py
patch
|
blob
|
history
diff --git
a/plomrogue/mapping.py
b/plomrogue/mapping.py
index 53e9d29fed1267d51e68dd2c19c2aa5626be6688..d4b19b1a8bad56d64aee96d1243aef6592b42e00 100644
(file)
--- a/
plomrogue/mapping.py
+++ b/
plomrogue/mapping.py
@@
-257,6
+257,12
@@
class SourcedMap(Map):
class DijkstraMap(SourcedMap):
def __init__(self, *args, **kwargs):
class DijkstraMap(SourcedMap):
def __init__(self, *args, **kwargs):
+ # TODO: check potential optimizations:
+ # - do a first pass circling out from the center
+ # - somehow ignore tiles that have the lowest possible value (we can
+ # compare with a precalculated map for given starting position)
+ # - check if Python offers more efficient data structures to use here
+ # - shorten radius to nearest possible target
super().__init__(*args, **kwargs)
self.terrain = [255] * self.size_i
self[self.center] = 0
super().__init__(*args, **kwargs)
self.terrain = [255] * self.size_i
self[self.center] = 0