Chiffres
Chiffres is a sentient economic system where value is alive. Certain in circulation, it mutates at rest in a cosmic gamble influenced by ethical actions and natural cycles. It's a currency that remembers its past, reacts to the collective present, and bets on the future.
Loading...
Searching...
No Matches
Chiffres::Chiffre Class Reference

Core abstraction of the Chiffres monetary system. More...

#include <Chiffre.h>

Public Member Functions

 Chiffre (double initial=0.0)
 Construct a wallet with an initial amount.
void spend (double amount)
 Spend from the wallet (deterministic).
void receive (double amount)
 Receive into the wallet (deterministic).
double mutate (const EthicsScore &ethics, const CyclePhase &cycle)
 Trigger a mutation when the wallet is at rest.
void set_state (State state) noexcept
 Set the current wallet state (Circulation or Rest).
State state () const noexcept
 Get current state.
double total () const noexcept
 Get current balance.
const Memory & memory () const noexcept
 Access memory snapshot (read-only).
void record_flow (double amount, bool incoming)
 Record a deterministic flow (called internally by spend/receive).

Detailed Description

Core abstraction of the Chiffres monetary system.

A Chiffres wallet is a living value container with two fundamental modes:

  • In circulation, transactions are exact and deterministic.
  • At rest, the value undergoes probabilistic mutations governed by:

The class encapsulates both deterministic accounting and stochastic dynamics.

Constructor & Destructor Documentation

◆ Chiffre()

Chiffre::Chiffre ( double initial = 0.0)
explicit

Construct a wallet with an initial amount.

Parameters
initialStarting balance.

Member Function Documentation

◆ mutate()

double Chiffre::mutate ( const EthicsScore & ethics,
const CyclePhase & cycle )

Trigger a mutation when the wallet is at rest.

Applies a stochastic multiplicative factor to the current balance. The distribution is log-normal and influenced by:

  • EthicsScore (stability/destabilization, drift bias)
  • CyclePhase (time-based variance modulation)
  • Memory (feedback from past events)
  • Ether (collective field density, self-regulation)
Parameters
ethicsEthical score of the actor.
cyclePosition within the cycle of time/nature.
Returns
The delta applied to the balance (positive = gain, negative = loss).
Note
If the wallet is not in State::Rest, returns 0.0 and does nothing.

◆ receive()

void Chiffre::receive ( double amount)

Receive into the wallet (deterministic).

Parameters
amountPositive amount to add.
Exceptions
std::invalid_argumentif amount < 0.

◆ record_flow()

void Chiffre::record_flow ( double amount,
bool incoming )

Record a deterministic flow (called internally by spend/receive).

Updates memory biases depending on:

  • The direction of the flow (incoming/outgoing).
  • The magnitude of the transaction.
Parameters
amountAbsolute amount of the flow.
incomingTrue if it is an incoming transaction.

◆ spend()

void Chiffre::spend ( double amount)

Spend from the wallet (deterministic).

Parameters
amountPositive amount to subtract.
Exceptions
std::invalid_argumentif amount < 0.

The documentation for this class was generated from the following files: