ruvector/examples/edge-net/sim/dist/cell.d.ts
rUv 383c791101 feat(edge-net): add Pi-Key crypto, lifecycle simulation, optimizations
- Add Pi-Key WASM cryptographic module with mathematical constant sizing
  - Pi-sized (314 bits/40 bytes) identity keys
  - Euler-sized (271 bits/34 bytes) session keys
  - Phi-sized (161 bits/21 bytes) genesis keys
  - Ed25519 signing + AES-256-GCM encryption

- Add comprehensive TypeScript lifecycle simulation (sim/)
  - 6 source files, 1,420 lines
  - Validates all 4 phases: Genesis → Growth → Maturation → Independence
  - Economic sustainability and phase transition testing

- Performance optimizations
  - FxHashMap for 30-50% faster lookups in evolution/mod.rs
  - VecDeque for O(1) front removal
  - Batched Q-learning updates in security/mod.rs
  - Fixed borrow checker error in process_batch_updates()

- Add benchmarks and documentation
  - BENCHMARKS.md with performance metrics
  - PERFORMANCE_OPTIMIZATIONS.md with details
  - docs/FINAL_REPORT.md comprehensive summary

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 01:29:11 +00:00

96 lines
No EOL
2.4 KiB
TypeScript

/**
* Cell (Node) Simulation
* Represents a single node in the edge-net network
*/
export declare enum CellType {
GENESIS = "genesis",
REGULAR = "regular"
}
export declare enum CellState {
ACTIVE = "active",
READ_ONLY = "read_only",
RETIRED = "retired"
}
export interface CellCapabilities {
computePower: number;
bandwidth: number;
reliability: number;
storage: number;
}
export interface CellMetrics {
tasksCompleted: number;
energyEarned: number;
energySpent: number;
connections: number;
uptime: number;
successRate: number;
}
export declare class Cell {
readonly id: string;
readonly type: CellType;
readonly joinedAtTick: number;
state: CellState;
capabilities: CellCapabilities;
energy: number;
metrics: CellMetrics;
connectedCells: Set<string>;
genesisMultiplier: number;
constructor(type: CellType, joinedAtTick: number, capabilities?: Partial<CellCapabilities>);
private randomCapability;
/**
* Process a task and earn energy
*/
processTask(taskComplexity: number, baseReward: number): boolean;
/**
* Spend energy (for network operations, connections, etc.)
*/
spendEnergy(amount: number): boolean;
/**
* Connect to another cell
*/
connectTo(cellId: string): void;
/**
* Disconnect from a cell
*/
disconnectFrom(cellId: string): void;
/**
* Update cell state based on network phase
*/
updateState(networkSize: number): void;
/**
* Simulate one tick of operation
*/
tick(): void;
/**
* Update success rate with exponential moving average
*/
private updateSuccessRate;
/**
* Get cell's overall fitness score
*/
getFitnessScore(): number;
/**
* Serialize cell state for reporting
*/
toJSON(): {
id: string;
type: CellType;
state: CellState;
joinedAtTick: number;
energy: number;
genesisMultiplier: number;
capabilities: CellCapabilities;
metrics: {
netEnergy: number;
tasksCompleted: number;
energyEarned: number;
energySpent: number;
connections: number;
uptime: number;
successRate: number;
};
connections: number;
fitnessScore: number;
};
}
//# sourceMappingURL=cell.d.ts.map