Syntropy.LatticeMath (syntropy v0.1.0)

Copy Markdown

Pure lattice math helpers shared by runtime modules and property tests.

Summary

Types

agent_like()

@type agent_like() :: map()

connection_value()

@type connection_value() :: %{weight: float(), interactions: non_neg_integer()}

score_vector()

@type score_vector() :: %{
  knowledge: float(),
  synthesis: float(),
  connections: float()
}

Functions

comparable_pairs(agents)

@spec comparable_pairs([agent_like()]) :: [{agent_like(), agent_like()}]

compute_position(scores)

@spec compute_position(score_vector()) :: float()

compute_scores(agent, opts \\ [])

@spec compute_scores(
  agent_like(),
  keyword()
) :: score_vector()

incomparable?(agent_a, agent_b)

@spec incomparable?(agent_like(), agent_like()) :: boolean()

incomparable_pairs(agents)

@spec incomparable_pairs([agent_like()]) :: [{agent_like(), agent_like()}]

join(agent_a, agent_b)

@spec join(agent_like(), agent_like()) :: agent_like()

meet(agent_a, agent_b)

@spec meet(agent_like(), agent_like()) :: agent_like()

recompute(agent, opts \\ [])

@spec recompute(
  agent_like(),
  keyword()
) :: agent_like()

signature(agent)

@spec signature(agent_like()) ::
  {[String.t()], [String.t()], [String.t()], score_vector()}

smooth_position(current_position, raw_position)

@spec smooth_position(float(), float()) :: float()

sort_agents(agents)

@spec sort_agents([agent_like()]) :: [agent_like()]