@@ -2,68 +2,19 @@ module RayCastWorlds
22
33import ReinforcementLearningBase as RLBase
44
5- reset! (world) = error (" Method not implemented" )
6- act! (world) = error (" Method not implemented" )
7- cast_rays! (world) = error (" Method not implemented" )
8- get_action_keys (env) = error (" Method not implemented" )
9- get_action_names (env) = error (" Method not implemented" )
10- play! (env) = error (" Method not implemented" )
11- update_top_view! (env) = error (" Method not implemented" )
12- update_camera_view! (env) = error (" Method not implemented" )
13-
14- function copy_image_to_frame_buffer! (frame_buffer, image)
15- height_image, width_image = size (image)
16- for j in 1 : width_image
17- for i in 1 : height_image
18- frame_buffer[j, i] = image[i, j]
19- end
20- end
21-
22- return nothing
23- end
24-
25- function sample_empty_position (rng, tile_map, region, max_tries)
26- position = rand (rng, region)
27-
28- for i in 1 : max_tries
29- if any (@view tile_map[:, position])
30- position = rand (rng, region)
31- else
32- return position
33- end
34- end
35-
36- @warn " Could not sample an empty position in max_tries = $(max_tries) . Returning non-empty position: $(position) "
37-
38- return position
39- end
40-
41- function sample_empty_position (rng, tile_map, region)
42- max_tries = 1024 * length (region)
43- position = sample_empty_position (rng, tile_map, region, max_tries)
44- return position
45- end
46-
47- function sample_empty_position (rng, tile_map, max_tries:: Integer )
48- _, height, width = size (tile_map)
49- region = CartesianIndices ((1 : height, 1 : width))
50- position = sample_empty_position (rng, tile_map, region, max_tries)
51- return position
52- end
53-
54- function sample_empty_position (rng, tile_map)
55- _, height, width = size (tile_map)
56- region = CartesianIndices ((1 : height, 1 : width))
57- max_tries = 1024 * height * width
58- position = sample_empty_position (rng, tile_map, region, max_tries)
59- return position
60- end
61-
625abstract type AbstractGame end
636
64- include (" units.jl" )
7+ function reset! end
8+ function act! end
9+ function cast_rays! end
10+ function get_action_keys end
11+ function get_action_names end
12+ function play! end
13+ function update_top_view! end
14+ function update_camera_view! end
15+
16+ include (" utils.jl" )
6517include (" collision_detection.jl" )
66- include (" navigation.jl" )
6718include (" rlbase.jl" )
6819include (" single_room.jl" )
6920
0 commit comments