mmore500 / evolvability-playground-concept

0 stars 0 forks source link

Add component to rescue cell entanglement by adjusting positions #2

Open mmore500 opened 1 year ago

mmore500 commented 1 year ago

Detect entanglement by seeing if any is angle between cell positions > 180 degrees (if dot products are negative) or maybe somehow by monitoring less-than/greater-than relationships between positions

mmore500 commented 1 year ago

sketch

class ApplyUntantle:
    def __call__(
        self: "ApplyUntangle",
        state: State,
        event_buffer: typing.Optional = None,
    ) -> None:

        dpxs = state.px[1:, :] - state.px[:-1, :]
        dpys = state.py[1:, :] - state.py[:-1, :]

        # up downs
        dots = dpxs[1:, :] * dpxs[:-1, :] + dpys[1:, :] * dpys[:-1, :]
        flags = dots < 0

        state.px