MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / pull

Function pull

hashes/chaos_machine.py:46–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44 machine_time += 1
45
46def pull():
47 global buffer_space, params_space, machine_time, \
48 K, m, t
49
50 # PRNG (Xorshift by George Marsaglia)
51 def xorshift(X, Y):
52 X ^= Y >> 13
53 Y ^= X << 17
54 X ^= Y >> 5
55 return X
56
57 # Choosing Dynamical Systems (Increment)
58 key = machine_time % m
59
60 # Evolution (Time Length)
61 for i in range(0, t):
62 # Variables (Position + Parameters)
63 r = params_space[key]
64 value = buffer_space[key]
65
66 # Modification (Transition Function) - Flow
67 buffer_space[key] = \
68 round(float(r * value * (1 - value)), 10)
69 params_space[key] = \
70 (machine_time * 0.01 + r * 1.01) % 1 + 3
71
72 # Choosing Chaotic Data
73 X = int(buffer_space[(key + 2) % m] * (10 ** 10))
74 Y = int(buffer_space[(key - 2) % m] * (10 ** 10))
75
76 # Machine Time
77 machine_time += 1
78
79 return xorshift(X, Y) % 0xFFFFFFFF
80
81def reset():
82 global buffer_space, params_space, machine_time, \

Callers 1

chaos_machine.pyFile · 0.85

Calls 1

xorshiftFunction · 0.85

Tested by

no test coverage detected