Skip to content

Commit 523472b

Browse files
committed
modified rng config
1 parent 167d8c5 commit 523472b

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

docs/sphinx_doc/stdlib/action.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
## Free Functions
44

5-
- **Function**: `can_apply_impl<FrameType, ActionType>(ActionType action, FrameType frame) -> Bool`
6-
- **Function**: `apply<FrameType, ActionType>(ActionType action, FrameType frame) `
75
- **Function**: `apply<FrameType, ActionType>(Vector<ActionType> action, FrameType frame) -> Bool`
86
- **Function**: `parse_and_execute<FrameType, AllActionsVariant>(FrameType state, AllActionsVariant variant, Vector<Byte> input, Int read_bytes) `
97
- **Function**: `parse_actions<AllActionsVariant>(AllActionsVariant variant, Vector<Byte> input, Int read_bytes) -> Vector<AllActionsVariant>`

docs/sphinx_doc/stdlib/machine_learning.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424

2525
### Methods
2626
- **Function**: `assign(T content) `
27+
- **Function**: `is_visible_to_all() -> Bool`
28+
- **Function**: `set_visible_by_all() `
29+
- **Function**: `set_visible_by_player(Int player_id) `
2730

2831
## Free Functions
2932

stdlib/rng.rl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ fun make_rng(Int seed) -> RNG:
5252

5353
act configure_rng() -> ConfigureRNG:
5454
frm rng : RNG
55+
frm seed : Int
5556
frm i : Int
5657
frm entry : Int
57-
while entry != 4:
58-
while i != 64:
59-
act set_rng_bit(Bool bit)
60-
rng.s[entry] = rng.s[entry] << 1
61-
rng.s[entry] = rng.s[entry] | int(bit)
62-
i = i + 1
63-
entry = entry + 1
58+
while i != 64:
59+
act set_rng_bit(Bool bit)
60+
seed = seed << 1
61+
seed = seed | int(bit)
62+
i = i + 1
63+
rng.set_seed(seed)
6464

6565

6666
fun size_as_observation_tensor(RNG obj) -> Int:

tool/rlc/test/configure_rng.rl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# RUN: python %pyscript/solve.py %s --stdlib %stdlib --rlc rlc
2+
import rng
3+
@classes
4+
act play() -> Game:
5+
subaction* config_rng = configure_rng()
6+
return config_rng.seed != 0

0 commit comments

Comments
 (0)