Skip to content
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

update_chaos_machine_documentation #12620

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
34 changes: 32 additions & 2 deletions hashes/chaos_machine.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@
"""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 unpredictable output ( meaning
small changes in input lead to drastically different outputs
over time),"""

""" 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)
# --> Stores values undergoing chaotic transformation.
buffer_space: list[float] = []

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

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

"""The push() function updates the buffer_space and
params_space by applying chaotic transformations
based on control theory. It modifies all values in the
buffer_space using an orbit change and trajectory
change formula, which ensure values to stay within
controlled chaotic limits. Finally, it increments
machine_time."""


def push(seed):
global buffer_space, params_space, machine_time, K, m, t
@@ -39,6 +61,14 @@ def push(seed):
machine_time += 1


"""The pull() function generates a chaotic pseudo-random
number using a logistic map transformation and the
Xorshift algorithm. It updates buffer_space and params_space
over multiple iterations, ensuring chaotic evolution. Finally,
it selects two chaotic values, applies Xorshift, and returns a
32-bit random number."""


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

Loading
Oops, something went wrong.