#r "nuget: ScottPlot, 5.0.55"
// Appareil du jumeau C# : RNG deterministe, substrats, six organes portes.
// Le RNG numpy (PCG64) n'est pas reproductible en .NET : on le remplace par un
// xorshift64* seede (meme choix que le jumeau ICT-15, #27734), lui aussi
// deterministe par graine. Gray-Scott et Axelrod rendent les memes signatures
// que la source (attracteur, dominance stable) ; Grokking et May rendent
// d'autres tirages, compares a tolerance de Monte-Carlo
// (cf. twin_pairs.d/ict-15c-metaproxyobstruction.yaml).
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using ScottPlot;
using Microsoft.DotNet.Interactive;
// ---------------------------------------------------------------------------
// RNG : xorshift64*
// ---------------------------------------------------------------------------
public sealed class Rng64
{
private ulong _x;
private double _spare;
private bool _hasSpare;
public Rng64(ulong seed)
{
_x = seed == 0UL ? 0x9E3779B97F4A7C15UL : seed;
}
public ulong NextUInt64()
{
ulong x = _x;
x ^= x >> 12;
x ^= x << 25;
x ^= x >> 27;
_x = x;
return x * 0x2545F4914F6CDD1DUL;
}
public double NextDouble() => (NextUInt64() >> 11) * (1.0 / 9007199254740992.0);
public int NextInt(int lo, int hi)
{
if (hi <= lo) return lo;
return lo + (int)(NextDouble() * (hi - lo));
}
// Box-Muller avec reserve (equivalent de Generator.standard_normal)
public double NextNormal()
{
if (_hasSpare) { _hasSpare = false; return _spare; }
double u1, u2, s;
do
{
u1 = 2.0 * NextDouble() - 1.0;
u2 = 2.0 * NextDouble() - 1.0;
s = u1 * u1 + u2 * u2;
} while (s >= 1.0 || s == 0.0);
double f = Math.Sqrt(-2.0 * Math.Log(s) / s);
_spare = u2 * f;
_hasSpare = true;
return u1 * f;
}
}
// ---------------------------------------------------------------------------
// Statistiques (conventions numpy : quantile 'linear', digitize a droite exclue,
// ecart-type de population ddof=0)
// ---------------------------------------------------------------------------
public static class Stats
{
public static double[] Linspace(double a, double b, int n)
{
var r = new double[n];
if (n <= 0) return r;
if (n == 1) { r[0] = a; return r; }
double step = (b - a) / (n - 1);
for (int i = 0; i < n - 1; i++) r[i] = a + i * step;
r[n - 1] = b;
return r;
}
public static double[] Quantiles(IEnumerable<double> data, double[] qs)
{
var sorted = data.ToArray();
Array.Sort(sorted);
int n = sorted.Length;
var res = new double[qs.Length];
if (n == 0) return res;
for (int k = 0; k < qs.Length; k++)
{
double pos = qs[k] * (n - 1);
int lo = (int)Math.Floor(pos);
if (lo < 0) lo = 0;
if (lo > n - 1) lo = n - 1;
int hi = Math.Min(lo + 1, n - 1);
double frac = pos - lo;
res[k] = sorted[lo] + frac * (sorted[hi] - sorted[lo]);
}
return res;
}
// np.digitize(x, bins) : index i tel que bins[i-1] <= x < bins[i]
public static int[] Digitize(double[] x, double[] bins)
{
var r = new int[x.Length];
for (int i = 0; i < x.Length; i++)
{
int idx = 0;
while (idx < bins.Length && x[i] >= bins[idx]) idx++;
r[i] = idx;
}
return r;
}
public static double[] Flatten(double[,] a)
{
int n = a.GetLength(0), m = a.GetLength(1);
var r = new double[n * m];
int k = 0;
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++) r[k++] = a[i, j];
return r;
}
public static double Mean(IReadOnlyList<double> v)
{
if (v.Count == 0) return 0.0;
double s = 0.0;
for (int i = 0; i < v.Count; i++) s += v[i];
return s / v.Count;
}
public static double StdPop(IReadOnlyList<double> v)
{
if (v.Count == 0) return 0.0;
double m = Mean(v);
double s = 0.0;
for (int i = 0; i < v.Count; i++) { double d = v[i] - m; s += d * d; }
return Math.Sqrt(s / v.Count);
}
public static double Percentile(double[] v, double p)
=> v.Length == 0 ? 0.0 : Quantiles(v, new[] { p })[0];
public static double Max(IReadOnlyList<double> v)
{
if (v.Count == 0) return 0.0;
double m = v[0];
for (int i = 1; i < v.Count; i++) if (v[i] > m) m = v[i];
return m;
}
public static double Min(IReadOnlyList<double> v)
{
if (v.Count == 0) return 0.0;
double m = v[0];
for (int i = 1; i < v.Count; i++) if (v[i] < m) m = v[i];
return m;
}
}
// ---------------------------------------------------------------------------
// Substrat 1 : Gray-Scott (port de ict.reaction_diffusion)
// ---------------------------------------------------------------------------
public sealed class GrayScott
{
public double F { get; }
public double Kill { get; }
public double Du { get; }
public double Dv { get; }
public double Dt { get; }
public GrayScott(double feed = 0.0367, double kill = 0.0649, double du = 0.16, double dv = 0.08, double step = 1.0)
{
F = feed; Kill = kill; Du = du; Dv = dv; Dt = step;
}
// Stencil 5 points a bords periodiques. L'ordre d'association reproduit
// celui de ict.reaction_diffusion.laplacian :
// roll(+1, axe0) + roll(-1, axe0) + roll(+1, axe1) + roll(-1, axe1) - 4*f
public static double[,] Laplacian(double[,] field)
{
int n = field.GetLength(0), m = field.GetLength(1);
var r = new double[n, m];
for (int i = 0; i < n; i++)
{
int im = (i - 1 + n) % n;
int ip = (i + 1) % n;
for (int j = 0; j < m; j++)
{
int jm = (j - 1 + m) % m;
int jp = (j + 1) % m;
r[i, j] = field[im, j] + field[ip, j] + field[i, jm] + field[i, jp] - 4.0 * field[i, j];
}
}
return r;
}
public (double[,] U, double[,] V) Seed(int n = 96, int block = 12, double noise = 0.02, Rng64 rng = null)
{
var U = new double[n, n];
var V = new double[n, n];
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++) U[i, j] = 1.0;
int lo = n / 2 - block / 2;
int hi = lo + block;
for (int i = lo; i < hi; i++)
for (int j = lo; j < hi; j++) { U[i, j] = 0.50; V[i, j] = 0.25; }
if (noise > 0.0)
{
var g = rng ?? new Rng64(0UL);
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
{
U[i, j] += noise * g.NextNormal();
V[i, j] += noise * g.NextNormal();
}
}
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
{
U[i, j] = Math.Clamp(U[i, j], 0.0, 1.0);
V[i, j] = Math.Clamp(V[i, j], 0.0, 1.0);
}
return (U, V);
}
public (double[,] U, double[,] V) Step(double[,] U, double[,] V)
{
var lapU = Laplacian(U);
var lapV = Laplacian(V);
int n = U.GetLength(0), m = U.GetLength(1);
var Un = new double[n, m];
var Vn = new double[n, m];
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
{
double reaction = U[i, j] * V[i, j] * V[i, j];
Un[i, j] = Math.Clamp(U[i, j] + Dt * (Du * lapU[i, j] - reaction + F * (1.0 - U[i, j])), 0.0, 1.0);
Vn[i, j] = Math.Clamp(V[i, j] + Dt * (Dv * lapV[i, j] + reaction - (F + Kill) * V[i, j]), 0.0, 1.0);
}
return (Un, Vn);
}
public (double[,] U, double[,] V) Run(double[,] U, double[,] V, int steps)
{
for (int t = 0; t < steps; t++)
{
var s = Step(U, V);
U = s.U; V = s.V;
}
return (U, V);
}
}
// ---------------------------------------------------------------------------
// Substrat 2 : Axelrod (port de ict.strategic_morphodynamics)
// ---------------------------------------------------------------------------
public delegate int StrategyFn(IReadOnlyList<int> own, IReadOnlyList<int> opp, Rng64 rng);
public static class Ipd
{
public const int C = 0;
public const int D = 1;
public static readonly double T = 5.0;
public static readonly double R = 3.0;
public static readonly double P = 1.0;
public static readonly double S = 0.0;
public static (double a, double b) PayoffPair(int a, int b)
{
if (a == C && b == C) return (R, R);
if (a == C && b == D) return (S, T);
if (a == D && b == C) return (T, S);
return (P, P);
}
public static int AllC(IReadOnlyList<int> own, IReadOnlyList<int> opp, Rng64 rng) => C;
public static int AllD(IReadOnlyList<int> own, IReadOnlyList<int> opp, Rng64 rng) => D;
public static int Tft(IReadOnlyList<int> own, IReadOnlyList<int> opp, Rng64 rng)
=> opp.Count == 0 ? C : opp[opp.Count - 1];
// Seule strategie consommatrice du RNG (protocole etendu #13322).
public static int GTft(IReadOnlyList<int> own, IReadOnlyList<int> opp, Rng64 rng)
{
if (opp.Count == 0) return C;
if (opp[opp.Count - 1] == C) return C;
return rng.NextDouble() < 1.0 / 3.0 ? C : D;
}
public static int Pavlov(IReadOnlyList<int> own, IReadOnlyList<int> opp, Rng64 rng)
{
if (own.Count == 0) return C;
int last = own[own.Count - 1];
int oppLast = opp[opp.Count - 1];
var (pa, _) = PayoffPair(last, oppLast);
bool won = pa >= R;
return won ? last : 1 - last;
}
public static int Grim(IReadOnlyList<int> own, IReadOnlyList<int> opp, Rng64 rng)
{
for (int i = 0; i < opp.Count; i++) if (opp[i] == D) return D;
return C;
}
// Ordre d'insertion identique au dict Python (dict preserve l'ordre).
public static List<KeyValuePair<string, StrategyFn>> MakeStrategies()
{
var l = new List<KeyValuePair<string, StrategyFn>>();
l.Add(new KeyValuePair<string, StrategyFn>("allc", AllC));
l.Add(new KeyValuePair<string, StrategyFn>("alld", AllD));
l.Add(new KeyValuePair<string, StrategyFn>("tft", Tft));
l.Add(new KeyValuePair<string, StrategyFn>("gtft", GTft));
l.Add(new KeyValuePair<string, StrategyFn>("pavlov", Pavlov));
l.Add(new KeyValuePair<string, StrategyFn>("grim", Grim));
return l;
}
public static (double g1, double g2) PlayMatch(StrategyFn s1, StrategyFn s2, int nRounds, double noise, Rng64 rng)
{
var own1 = new List<int>();
var own2 = new List<int>();
double g1 = 0.0, g2 = 0.0;
for (int t = 0; t < nRounds; t++)
{
int a = s1(own1, own2, rng);
int b = s2(own2, own1, rng);
if (noise > 0.0)
{
if (rng.NextDouble() < noise) a = 1 - a;
if (rng.NextDouble() < noise) b = 1 - b;
}
var (pa, pb) = PayoffPair(a, b);
g1 += pa; g2 += pb;
own1.Add(a); own2.Add(b);
}
return (g1 / nRounds, g2 / nRounds);
}
public static double[,] PayoffMatrix(List<KeyValuePair<string, StrategyFn>> strategies,
int nRounds, int nReps, Rng64 rng)
{
int n = strategies.Count;
var A = new double[n, n];
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
{
double sum = 0.0;
for (int r = 0; r < nReps; r++)
{
var (gi, _) = PlayMatch(strategies[i].Value, strategies[j].Value, nRounds, 0.0, rng);
sum += gi;
}
A[i, j] = sum / nReps;
}
return A;
}
public static double[,] ReplicatorTrajectory(double[,] A, double[] x0, int nSteps)
{
int n = x0.Length;
var x = (double[])x0.Clone();
double total = 0.0;
for (int i = 0; i < n; i++) total += x[i];
for (int i = 0; i < n; i++) x[i] /= total;
var traj = new double[nSteps + 1, n];
for (int i = 0; i < n; i++) traj[0, i] = x[i];
for (int t = 0; t < nSteps; t++)
{
var f = new double[n];
for (int i = 0; i < n; i++)
{
double s = 0.0;
for (int j = 0; j < n; j++) s += A[i, j] * x[j];
f[i] = s;
}
double avg = 0.0;
for (int i = 0; i < n; i++) avg += f[i] * x[i];
if (avg < 1e-12) break;
double tot = 0.0;
for (int i = 0; i < n; i++)
{
x[i] = Math.Max(0.0, x[i] * f[i] / avg);
tot += x[i];
}
if (tot > 1e-12)
for (int i = 0; i < n; i++) x[i] /= tot;
for (int i = 0; i < n; i++) traj[t + 1, i] = x[i];
}
return traj;
}
}
// ---------------------------------------------------------------------------
// Substrat 4 : May (port de ict.bistable.GrazingModel.simulate_sde)
// ---------------------------------------------------------------------------
public sealed class Grazing
{
public double R { get; }
public double K { get; }
public double H { get; }
public Grazing(double r = 1.0, double k = 10.0, double h = 1.0) { R = r; K = k; H = h; }
public double Rate(double x, double c)
=> R * x * (1.0 - x / K) - c * x * x / (x * x + H * H);
public double[] SimulateSde(double c, double x0, double sigma, double dt, int T, ulong seed)
{
var g = new Rng64(seed);
double sq = Math.Sqrt(dt);
double x = x0;
var xs = new double[T];
for (int t = 0; t < T; t++)
{
x = x + dt * Rate(x, c) + sigma * sq * g.NextNormal();
if (x < 0.0) x = 0.0;
xs[t] = x;
}
return xs;
}
}
// ---------------------------------------------------------------------------
// Organe spectral (port de ict.spectral : matrice de transition, graphe
// symetrique sans boucle, Laplacien, gap)
// ---------------------------------------------------------------------------
public static class Spectral
{
// P[s, t] += 1 seulement si les deux indices sont dans [0, n) ; les paires
// hors bornes sont silencieusement ignorees (convention de la source).
public static double[,] TransitionMatrix(IReadOnlyList<int> states, int nSymbols, double eps = 1e-9)
{
var P = new double[nSymbols, nSymbols];
for (int i = 0; i < nSymbols; i++)
for (int j = 0; j < nSymbols; j++) P[i, j] = eps;
for (int t = 0; t + 1 < states.Count; t++)
{
int s = states[t], u = states[t + 1];
if (s >= 0 && s < nSymbols && u >= 0 && u < nSymbols) P[s, u] += 1.0;
}
for (int i = 0; i < nSymbols; i++)
{
double sum = 0.0;
for (int j = 0; j < nSymbols; j++) sum += P[i, j];
if (sum > 0.0)
for (int j = 0; j < nSymbols; j++) P[i, j] /= sum;
}
return P;
}
public static double[,] TransitionGraph(IReadOnlyList<int> states, int nSymbols)
{
var P = TransitionMatrix(states, nSymbols);
var W = new double[nSymbols, nSymbols];
for (int i = 0; i < nSymbols; i++)
for (int j = 0; j < nSymbols; j++) W[i, j] = (P[i, j] + P[j, i]) / 2.0;
for (int i = 0; i < nSymbols; i++) W[i, i] = 0.0;
return W;
}
// Valeurs propres par Jacobi cyclique (matrice symetrique reelle).
public static double[] SymmetricEigenvalues(double[,] A, int maxSweeps = 100)
{
int n = A.GetLength(0);
var a = (double[,])A.Clone();
for (int sweep = 0; sweep < maxSweeps; sweep++)
{
double off = 0.0;
for (int i = 0; i < n; i++)
for (int j = i + 1; j < n; j++) off += a[i, j] * a[i, j];
if (off < 1e-30) break;
for (int p = 0; p < n - 1; p++)
for (int q = p + 1; q < n; q++)
{
if (Math.Abs(a[p, q]) < 1e-18) continue;
double theta = (a[q, q] - a[p, p]) / (2.0 * a[p, q]);
double t = theta == 0.0
? 1.0
: Math.Sign(theta) / (Math.Abs(theta) + Math.Sqrt(theta * theta + 1.0));
double c = 1.0 / Math.Sqrt(t * t + 1.0);
double s = t * c;
for (int k = 0; k < n; k++)
{
double akp = a[k, p], akq = a[k, q];
a[k, p] = c * akp - s * akq;
a[k, q] = s * akp + c * akq;
}
for (int k = 0; k < n; k++)
{
double apk = a[p, k], aqk = a[q, k];
a[p, k] = c * apk - s * aqk;
a[q, k] = s * apk + c * aqk;
}
}
}
var eigs = new double[n];
for (int i = 0; i < n; i++) eigs[i] = a[i, i];
Array.Sort(eigs);
return eigs;
}
public static double[] LaplacianSpectrum(double[,] W)
{
int n = W.GetLength(0);
var L = new double[n, n];
for (int i = 0; i < n; i++)
{
double d = 0.0;
for (int j = 0; j < n; j++) d += W[i, j];
for (int j = 0; j < n; j++) L[i, j] = -W[i, j];
L[i, i] = d; // D - W, et W_ii = 0
}
return SymmetricEigenvalues(L);
}
public static double SpectralGap(double[,] W)
{
var eigs = LaplacianSpectrum(W);
if (eigs.Length < 2) return double.NaN;
return eigs[1] - eigs[0];
}
public static double SpectralGapOf(IReadOnlyList<int> states, int nSymbols)
=> SpectralGap(TransitionGraph(states, nSymbols));
}
// ---------------------------------------------------------------------------
// Organe de sensibilite (port de ict.sensitivity, correctif #9764 : voisinage
// lu sur les transitions OBSERVEES, pas sur le graphe lisse)
// ---------------------------------------------------------------------------
public sealed class SensitivitySummary
{
public double max;
public double mean;
public double std;
public double p95;
public int n_visited;
}
public static class Sensitivity
{
// Ids compacts par ordre de PREMIERE APPARITION ; leve si un nouveau label
// apparait alors que n_symbols est deja atteint.
public static int[] EncodeLabels(IReadOnlyList<int> states, int nSymbols)
{
var map = new Dictionary<int, int>();
var ids = new int[states.Count];
for (int i = 0; i < states.Count; i++)
{
int lab = states[i];
if (!map.TryGetValue(lab, out int id))
{
if (map.Count >= nSymbols)
throw new InvalidOperationException(
$"trop de labels distincts pour n_symbols={nSymbols}");
id = map.Count;
map[lab] = id;
}
ids[i] = id;
}
return ids;
}
// Adjacence OBSERVEE : booleenne, symetrique, boucles exclues, paires hors
// bornes ignorees, aucun lissage.
public static bool[,] ObservedAdjacency(IReadOnlyList<int> states, int nSymbols)
{
var A = new bool[nSymbols, nSymbols];
for (int t = 0; t + 1 < states.Count; t++)
{
int s = states[t], u = states[t + 1];
if (s == u) continue;
if (s < 0 || s >= nSymbols || u < 0 || u >= nSymbols) continue;
A[s, u] = true;
A[u, s] = true;
}
return A;
}
public static int[] Local(IReadOnlyList<int> states, int nSymbols, Func<int, int> f)
{
var ids = EncodeLabels(states, nSymbols);
var A = ObservedAdjacency(ids, nSymbols);
var fVals = new int[nSymbols];
for (int i = 0; i < nSymbols; i++) fVals[i] = f(i);
var s = new int[nSymbols];
for (int x = 0; x < nSymbols; x++)
{
int count = 0;
for (int y = 0; y < nSymbols; y++)
if (A[x, y] && fVals[y] != fVals[x]) count++;
s[x] = count;
}
return s;
}
// Les noeuds visites occupent les ids 0..n_visited-1 (encodage compact par
// premiere apparition) : le prefixe suffit.
public static SensitivitySummary Distribution(IReadOnlyList<int> states, int nSymbols, Func<int, int> f)
{
var s = Local(states, nSymbols, f);
var distinct = new HashSet<int>(states);
int nVisited = distinct.Count;
var visited = new List<double>();
for (int i = 0; i < Math.Min(nVisited, s.Length); i++) visited.Add(s[i]);
return new SensitivitySummary
{
max = visited.Count == 0 ? 0.0 : Stats.Max(visited),
mean = visited.Count == 0 ? 0.0 : Stats.Mean(visited),
std = visited.Count == 0 ? 0.0 : Stats.StdPop(visited),
p95 = visited.Count == 0 ? 0.0 : Stats.Percentile(visited.ToArray(), 95),
n_visited = nVisited
};
}
}
// ---------------------------------------------------------------------------
// Meta-proxy (port de ict.meta_proxy : signature, vecteur d'obstruction,
// aggregation cross-substrat)
// ---------------------------------------------------------------------------
public sealed class Signature
{
public int n_states;
public int n_transitions;
public double spectral_gap;
public double sensitivity_mean;
public double sensitivity_max;
public double this[string key]
{
get
{
switch (key)
{
case "spectral_gap": return spectral_gap;
case "sensitivity_mean": return sensitivity_mean;
case "sensitivity_max": return sensitivity_max;
case "n_states": return n_states;
case "n_transitions": return n_transitions;
default: return 0.0;
}
}
}
}
public sealed class VerdictResult
{
public int n_substrats;
public List<double> pairwise_norms;
public double mean_norm_l2;
public double max_norm_l2;
public double stable_threshold;
public double noise_threshold;
public string verdict;
}
public static class MetaProxy
{
public static readonly string[] DefaultKeys = { "spectral_gap", "sensitivity_mean", "sensitivity_max" };
public static Signature SignatureFrom(IReadOnlyList<int> states, int nSymbols,
Func<IReadOnlyList<int>, int, double> spectralFn,
Func<IReadOnlyList<int>, int, double> meanFn,
Func<IReadOnlyList<int>, int, double> maxFn)
{
if (nSymbols < 2) throw new ArgumentException("n_symbols doit etre >= 2");
if (states.Count == 0) throw new ArgumentException("states vide");
if (states.Count < 2) throw new ArgumentException("states doit contenir >= 2 pas");
return new Signature
{
n_states = states.Count,
n_transitions = states.Count - 1,
spectral_gap = spectralFn(states, nSymbols),
sensitivity_mean = meanFn(states, nSymbols),
sensitivity_max = maxFn(states, nSymbols)
};
}
public static Signature Signature(IReadOnlyList<int> states, int nSymbols)
=> SignatureFrom(states, nSymbols,
(st, n) => Spectral.SpectralGapOf(st, n),
(st, n) => Sensitivity.Distribution(st, n, x => x).mean,
(st, n) => Sensitivity.Distribution(st, n, x => x).max);
public static (double spectral, double sensMean, double sensMax, double normL2)
ObstructionVector(Signature a, Signature b, string[] keys = null)
{
keys = keys ?? DefaultKeys;
const double eps = 1e-12;
double sg = 0.0, sm = 0.0, sx = 0.0;
double sumSq = 0.0;
foreach (var k in keys)
{
double va = a[k], vb = b[k];
if (double.IsNaN(va) || double.IsInfinity(va)) va = 0.0;
if (double.IsNaN(vb) || double.IsInfinity(vb)) vb = 0.0;
double d = (va - vb) / (Math.Abs(va) + Math.Abs(vb) + eps);
sumSq += d * d;
if (k == "spectral_gap") sg = d;
else if (k == "sensitivity_mean") sm = d;
else if (k == "sensitivity_max") sx = d;
}
return (sg, sm, sx, Math.Sqrt(sumSq));
}
public static VerdictResult CrossSubstratObstruction(
IReadOnlyList<KeyValuePair<string, Signature>> sigs,
double stableThreshold = 0.05, double noiseThreshold = 0.30)
{
if (sigs.Count < 2) throw new ArgumentException("cross_substrat_obstruction necessite >= 2 substrats");
var norms = new List<double>();
for (int i = 0; i < sigs.Count; i++)
for (int j = i + 1; j < sigs.Count; j++)
norms.Add(ObstructionVector(sigs[i].Value, sigs[j].Value).normL2);
double mean = Stats.Mean(norms);
double max = Stats.Max(norms);
string verdict = mean <= stableThreshold ? "STABLE"
: (mean >= noiseThreshold ? "NOISE" : "INCONCLUSIVE");
return new VerdictResult
{
n_substrats = sigs.Count,
pairwise_norms = norms,
mean_norm_l2 = mean,
max_norm_l2 = max,
stable_threshold = stableThreshold,
noise_threshold = noiseThreshold,
verdict = verdict
};
}
}
// ---------------------------------------------------------------------------
// Deux couleurs de texte pour la figure
// ---------------------------------------------------------------------------
public static class Palette
{
public static readonly ScottPlot.Color Blanc = new ScottPlot.Color(255, 255, 255);
public static readonly ScottPlot.Color Noir = new ScottPlot.Color(0, 0, 0);
}
// ---------------------------------------------------------------------------
// Culture (c.94 : les TROIS setters, sinon separateur decimal virgule)
// ---------------------------------------------------------------------------
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture;
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture;
Console.WriteLine("meta_proxy porte en C#. Substrats pilotes : Gray-Scott, Axelrod, Grokking, May (ICT-8).");