Skip to content

Question on the hash_state_action function #1

@xiaojunxu

Description

@xiaojunxu

def hash_state_action(s_t, a_t):
key = s_t[0]
base = 179424673
for e in s_t[1].directed_edges:
key = (key * base + e[0]) % base
key = (key * base + e[1]) % base
if s_t[2] is not None:
key = (key * base + s_t[2]) % base
else:
key = (key * base) % base
key = (key * base + a_t) % base
return key

Is this hash function problematic? It seems that this function is equivalent to key = a_t % base.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions