Skip to content

updated_chaos_machine_algorithm_documentation #12618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions hashes/chaos_machine.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
"""example of simple chaos machine"""
"""example of simple chaos machine
Simple Chaos Machine refers to computational model that demonstrates chaotic behavior.
It takes input values, applies a chaotic transformation using control theory principles, and generates

Check failure on line 3 in hashes/chaos_machine.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

hashes/chaos_machine.py:3:89: E501 Line too long (102 > 88)
unpredictable output ( meaning small changes in input lead to drastically different outputs over time),"""

Check failure on line 4 in hashes/chaos_machine.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

hashes/chaos_machine.py:4:89: E501 Line too long (106 > 88)

""" Chaos Machine (K, t, m)
K --> Initial values for the buffer space.
t --> Time length for evolution (how long transformations happen).
m --> Number of elements in the chaotic system."""

# Chaos Machine (K, t, m)
K = [0.33, 0.44, 0.55, 0.44, 0.33]
t = 3
m = 5

# Buffer Space (with Parameters Space)
# Buffer Space (with Parameters Space) --> Stores values undergoing chaotic transformation.

Check failure on line 15 in hashes/chaos_machine.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

hashes/chaos_machine.py:15:89: E501 Line too long (91 > 88)
buffer_space: list[float] = []

# Stores parameters controlling the transformation.
params_space: list[float] = []

# Machine Time
# Machine Time --> Keeps track of execution time.
machine_time = 0

"""The push() function updates the buffer_space and params_space by applying chaotic transformations

Check failure on line 24 in hashes/chaos_machine.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

hashes/chaos_machine.py:24:89: E501 Line too long (100 > 88)
based on control theory. It modifies all values in the buffer_space using an orbit change and trajectory change formula,

Check failure on line 25 in hashes/chaos_machine.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

hashes/chaos_machine.py:25:89: E501 Line too long (120 > 88)
which ensure values to stay within controlled chaotic limits. Finally, it increments machine_time."""

Check failure on line 26 in hashes/chaos_machine.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

hashes/chaos_machine.py:26:89: E501 Line too long (101 > 88)


def push(seed):
global buffer_space, params_space, machine_time, K, m, t
Expand Down Expand Up @@ -39,6 +52,11 @@
machine_time += 1


"""The pull() function generates a chaotic pseudo-random number using a logistic map transformation

Check failure on line 55 in hashes/chaos_machine.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

hashes/chaos_machine.py:55:89: E501 Line too long (99 > 88)
and the Xorshift algorithm. It updates buffer_space and params_space over multiple iterations, ensuring chaotic evolution.

Check failure on line 56 in hashes/chaos_machine.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

hashes/chaos_machine.py:56:89: E501 Line too long (122 > 88)
Finally, it selects two chaotic values, applies Xorshift, and returns a 32-bit random number."""

Check failure on line 57 in hashes/chaos_machine.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

hashes/chaos_machine.py:57:89: E501 Line too long (96 > 88)


def pull():
global buffer_space, params_space, machine_time, K, m, t

Expand Down
Loading