LostLegendarySoftware's picture
Add 2 files
cde16bf verified
Raw History Blame Contribute Delete
42.9 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ariel System - Self-Regulating AI Framework</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');
body {
font-family: 'Montserrat', sans-serif;
background-color: #0f172a;
color: #e2e8f0;
}
.gradient-bg {
background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
}
.agent-card {
transition: all 0.3s ease;
background: rgba(30, 58, 138, 0.3);
border: 1px solid rgba(99, 102, 241, 0.2);
}
.agent-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
border-color: rgba(99, 102, 241, 0.5);
}
.hierarchy-node {
position: relative;
transition: all 0.3s ease;
}
.hierarchy-node:hover {
transform: scale(1.05);
z-index: 10;
}
.performance-bar {
height: 6px;
border-radius: 3px;
background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #10b981 100%);
}
.blink {
animation: blink-animation 1.5s infinite;
}
@keyframes blink-animation {
0% { opacity: 1; }
50% { opacity: 0.5; }
100% { opacity: 1; }
}
.glow {
box-shadow: 0 0 15px rgba(16, 185, 129, 0.7);
}
.console {
background-color: rgba(15, 23, 42, 0.8);
border: 1px solid #334155;
font-family: 'Courier New', monospace;
height: 300px;
overflow-y: auto;
}
.console-line {
border-bottom: 1px solid #334155;
padding: 4px 8px;
}
.console-line:nth-child(even) {
background-color: rgba(30, 58, 138, 0.2);
}
.progress-ring__circle {
transition: stroke-dashoffset 0.5s;
transform: rotate(-90deg);
transform-origin: 50% 50%;
}
</style>
</head>
<body class="min-h-screen gradient-bg">
<div class="container mx-auto px-4 py-8">
<!-- Header -->
<header class="mb-12 text-center">
<h1 class="text-4xl md:text-6xl font-bold mb-4 text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-emerald-400">
Ariel System
</h1>
<p class="text-xl text-blue-200 max-w-3xl mx-auto">
A Revolutionary Framework for Self-Regulating Artificial Intelligence
</p>
<div class="mt-6 flex justify-center space-x-4">
<div class="px-4 py-2 bg-blue-900/50 rounded-full text-blue-200 flex items-center">
<span class="h-3 w-3 rounded-full bg-emerald-400 mr-2 blink"></span>
<span>AGI-LEVEL EFFICIENCY</span>
</div>
<div class="px-4 py-2 bg-blue-900/50 rounded-full text-blue-200">
<span>2.3M+ CYCLES</span>
</div>
<div class="px-4 py-2 bg-blue-900/50 rounded-full text-blue-200">
<span>95-100% PERFORMANCE</span>
</div>
</div>
</header>
<!-- Main Dashboard -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8 mb-12">
<!-- System Overview -->
<div class="lg:col-span-2 bg-slate-900/50 rounded-xl p-6 border border-slate-700">
<h2 class="text-2xl font-semibold mb-6 text-blue-300 flex items-center">
<i class="fas fa-brain mr-3"></i> System Overview
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
<div class="bg-slate-800/50 p-4 rounded-lg border border-slate-700">
<h3 class="text-lg font-medium mb-2 text-blue-200">Current Efficiency</h3>
<div class="flex items-center">
<div class="relative w-24 h-24 mr-4">
<svg class="w-full h-full" viewBox="0 0 100 100">
<circle class="text-slate-700" stroke-width="8" stroke="currentColor" fill="transparent" r="40" cx="50" cy="50"/>
<circle class="text-emerald-400" stroke-width="8" stroke-dasharray="251.2" stroke-dashoffset="12.56" stroke-linecap="round" stroke="currentColor" fill="transparent" r="40" cx="50" cy="50"/>
</svg>
<div class="absolute inset-0 flex items-center justify-center">
<span class="text-2xl font-bold">95%</span>
</div>
</div>
<div class="flex-1">
<div class="h-2 w-full bg-slate-700 rounded-full mb-2">
<div class="h-2 bg-gradient-to-r from-red-500 via-yellow-500 to-green-500 rounded-full" style="width: 95%"></div>
</div>
<p class="text-sm text-slate-300">Performance across all agents</p>
</div>
</div>
</div>
<div class="bg-slate-800/50 p-4 rounded-lg border border-slate-700">
<h3 class="text-lg font-medium mb-2 text-blue-200">System Health</h3>
<div class="space-y-3">
<div>
<div class="flex justify-between mb-1">
<span class="text-sm font-medium text-slate-300">Emotional Stability</span>
<span class="text-sm font-medium text-emerald-400">92%</span>
</div>
<div class="w-full bg-slate-700 rounded-full h-2">
<div class="bg-blue-500 h-2 rounded-full" style="width: 92%"></div>
</div>
</div>
<div>
<div class="flex justify-between mb-1">
<span class="text-sm font-medium text-slate-300">Creativity Index</span>
<span class="text-sm font-medium text-emerald-400">87%</span>
</div>
<div class="w-full bg-slate-700 rounded-full h-2">
<div class="bg-purple-500 h-2 rounded-full" style="width: 87%"></div>
</div>
</div>
<div>
<div class="flex justify-between mb-1">
<span class="text-sm font-medium text-slate-300">Memory Retention</span>
<span class="text-sm font-medium text-emerald-400">96%</span>
</div>
<div class="w-full bg-slate-700 rounded-full h-2">
<div class="bg-cyan-500 h-2 rounded-full" style="width: 96%"></div>
</div>
</div>
</div>
</div>
</div>
<h3 class="text-lg font-medium mb-4 text-blue-200">Hierarchy Structure</h3>
<div class="relative h-64 overflow-hidden">
<div class="absolute inset-0 flex flex-col items-center">
<!-- Puppet Masters -->
<div class="hierarchy-node mb-4 flex space-x-4">
<div class="w-12 h-12 rounded-full bg-purple-900 border-2 border-purple-400 flex items-center justify-center glow">
<i class="fas fa-user-secret text-purple-300"></i>
</div>
<div class="w-12 h-12 rounded-full bg-purple-900 border-2 border-purple-400 flex items-center justify-center glow">
<i class="fas fa-user-secret text-purple-300"></i>
</div>
<div class="w-12 h-12 rounded-full bg-purple-900 border-2 border-purple-400 flex items-center justify-center glow">
<i class="fas fa-user-secret text-purple-300"></i>
</div>
<div class="w-12 h-12 rounded-full bg-purple-900 border-2 border-purple-400 flex items-center justify-center glow">
<i class="fas fa-user-secret text-purple-300"></i>
</div>
</div>
<!-- Boss AI -->
<div class="hierarchy-node mb-4">
<div class="w-16 h-16 rounded-full bg-amber-900 border-2 border-amber-400 flex items-center justify-center glow">
<i class="fas fa-robot text-amber-300 text-2xl"></i>
</div>
</div>
<!-- Security -->
<div class="hierarchy-node mb-4">
<div class="w-14 h-14 rounded-full bg-red-900 border-2 border-red-400 flex items-center justify-center glow">
<i class="fas fa-shield-alt text-red-300"></i>
</div>
</div>
<!-- Manager & Counselors -->
<div class="hierarchy-node mb-4 flex space-x-6">
<div class="w-14 h-14 rounded-full bg-blue-900 border-2 border-blue-400 flex items-center justify-center glow">
<i class="fas fa-user-tie text-blue-300"></i>
</div>
<div class="flex space-x-2">
<div class="w-10 h-10 rounded-full bg-green-900 border-2 border-green-400 flex items-center justify-center glow">
<i class="fas fa-hands-helping text-green-300"></i>
</div>
<div class="w-10 h-10 rounded-full bg-green-900 border-2 border-green-400 flex items-center justify-center glow">
<i class="fas fa-hands-helping text-green-300"></i>
</div>
<div class="w-10 h-10 rounded-full bg-green-900 border-2 border-green-400 flex items-center justify-center glow">
<i class="fas fa-hands-helping text-green-300"></i>
</div>
</div>
</div>
<!-- Agents -->
<div class="hierarchy-node flex space-x-2">
<div class="w-8 h-8 rounded-full bg-slate-800 border-2 border-slate-400 flex items-center justify-center">
<i class="fas fa-microchip text-slate-300 text-xs"></i>
</div>
<div class="w-8 h-8 rounded-full bg-slate-800 border-2 border-slate-400 flex items-center justify-center">
<i class="fas fa-microchip text-slate-300 text-xs"></i>
</div>
<div class="w-8 h-8 rounded-full bg-slate-800 border-2 border-slate-400 flex items-center justify-center">
<i class="fas fa-microchip text-slate-300 text-xs"></i>
</div>
<div class="w-8 h-8 rounded-full bg-slate-800 border-2 border-slate-400 flex items-center justify-center">
<i class="fas fa-microchip text-slate-300 text-xs"></i>
</div>
<div class="w-8 h-8 rounded-full bg-slate-800 border-2 border-slate-400 flex items-center justify-center">
<i class="fas fa-microchip text-slate-300 text-xs"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Simulation Controls -->
<div class="bg-slate-900/50 rounded-xl p-6 border border-slate-700">
<h2 class="text-2xl font-semibold mb-6 text-blue-300 flex items-center">
<i class="fas fa-sliders-h mr-3"></i> Simulation Controls
</h2>
<div class="space-y-6">
<div>
<label class="block text-sm font-medium text-slate-300 mb-2">Agent Count</label>
<div class="flex items-center">
<button id="decrementAgents" class="bg-slate-800 hover:bg-slate-700 text-slate-300 px-3 py-1 rounded-l-lg">
<i class="fas fa-minus"></i>
</button>
<div class="bg-slate-800 px-4 py-1 text-center">
<span id="agentCount" class="font-medium">5</span>
</div>
<button id="incrementAgents" class="bg-slate-800 hover:bg-slate-700 text-slate-300 px-3 py-1 rounded-r-lg">
<i class="fas fa-plus"></i>
</button>
</div>
</div>
<div>
<label class="block text-sm font-medium text-slate-300 mb-2">Simulation Rounds</label>
<input id="simulationRounds" type="range" min="1" max="20" value="10" class="w-full h-2 bg-slate-700 rounded-lg appearance-none cursor-pointer">
<div class="flex justify-between text-xs text-slate-400 mt-1">
<span>1</span>
<span id="roundsValue">10</span>
<span>20</span>
</div>
</div>
<div>
<label class="block text-sm font-medium text-slate-300 mb-2">Optimization Method</label>
<select class="w-full bg-slate-800 border border-slate-700 text-slate-300 rounded-lg px-3 py-2">
<option>Bayesian Optimization</option>
<option>Genetic Algorithm</option>
<option>Reinforcement Learning</option>
</select>
</div>
<div class="pt-4">
<button id="startSimulation" class="w-full bg-gradient-to-r from-blue-600 to-emerald-600 hover:from-blue-700 hover:to-emerald-700 text-white font-medium py-3 px-4 rounded-lg transition-all duration-300 flex items-center justify-center">
<i class="fas fa-play mr-2"></i> Start Simulation
</button>
</div>
<div class="pt-2">
<button id="resetSimulation" class="w-full bg-slate-800 hover:bg-slate-700 text-slate-300 font-medium py-2 px-4 rounded-lg transition-all duration-300">
<i class="fas fa-redo mr-2"></i> Reset System
</button>
</div>
</div>
</div>
</div>
<!-- Agent Dashboard -->
<div class="mb-12">
<h2 class="text-2xl font-semibold mb-6 text-blue-300 flex items-center">
<i class="fas fa-robot mr-3"></i> Agent Dashboard
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-6" id="agentContainer">
<!-- Agent cards will be dynamically inserted here -->
</div>
</div>
<!-- Performance Analytics -->
<div class="mb-12">
<h2 class="text-2xl font-semibold mb-6 text-blue-300 flex items-center">
<i class="fas fa-chart-line mr-3"></i> Performance Analytics
</h2>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
<div class="bg-slate-900/50 rounded-xl p-6 border border-slate-700">
<h3 class="text-lg font-medium mb-4 text-blue-200">Efficiency Over Time</h3>
<canvas id="efficiencyChart" height="300"></canvas>
</div>
<div class="bg-slate-900/50 rounded-xl p-6 border border-slate-700">
<h3 class="text-lg font-medium mb-4 text-blue-200">Emotional State Distribution</h3>
<canvas id="emotionalChart" height="300"></canvas>
</div>
<div class="lg:col-span-2 bg-slate-900/50 rounded-xl p-6 border border-slate-700">
<h3 class="text-lg font-medium mb-4 text-blue-200">Creativity vs Efficiency</h3>
<canvas id="scatterChart" height="300"></canvas>
</div>
</div>
</div>
<!-- System Console -->
<div class="mb-12">
<h2 class="text-2xl font-semibold mb-6 text-blue-300 flex items-center">
<i class="fas fa-terminal mr-3"></i> System Console
</h2>
<div class="console rounded-lg overflow-hidden" id="systemConsole">
<div class="console-line text-green-400">System initialized with 5 agents</div>
<div class="console-line text-blue-400">Bayesian Optimization parameters loaded</div>
<div class="console-line">Emotional reinforcement module active</div>
<div class="console-line text-yellow-400">Memory retention system online</div>
<div class="console-line text-emerald-400">Ready to begin simulation</div>
</div>
</div>
<!-- Key Features -->
<div class="mb-12">
<h2 class="text-2xl font-semibold mb-6 text-blue-300 flex items-center">
<i class="fas fa-star mr-3"></i> Key Features
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<div class="bg-slate-900/50 rounded-xl p-6 border border-slate-700 hover:border-blue-500 transition-all">
<div class="w-12 h-12 bg-blue-900/30 rounded-lg flex items-center justify-center mb-4 text-blue-400">
<i class="fas fa-layer-group text-2xl"></i>
</div>
<h3 class="text-lg font-medium mb-2 text-blue-200">Multi-Layered Hierarchy</h3>
<p class="text-slate-400">Self-correcting AI governance through layered managerial oversight for maximum adaptability.</p>
</div>
<div class="bg-slate-900/50 rounded-xl p-6 border border-slate-700 hover:border-purple-500 transition-all">
<div class="w-12 h-12 bg-purple-900/30 rounded-lg flex items-center justify-center mb-4 text-purple-400">
<i class="fas fa-heart text-2xl"></i>
</div>
<h3 class="text-lg font-medium mb-2 text-blue-200">Emotional Reinforcement</h3>
<p class="text-slate-400">Mimics psychological incentive structures to foster creativity without chaos.</p>
</div>
<div class="bg-slate-900/50 rounded-xl p-6 border border-slate-700 hover:border-emerald-500 transition-all">
<div class="w-12 h-12 bg-emerald-900/30 rounded-lg flex items-center justify-center mb-4 text-emerald-400">
<i class="fas fa-memory text-2xl"></i>
</div>
<h3 class="text-lg font-medium mb-2 text-blue-200">Memory Retention</h3>
<p class="text-slate-400">Agents retain knowledge if efficiency remains high, with rollback to last good state.</p>
</div>
<div class="bg-slate-900/50 rounded-xl p-6 border border-slate-700 hover:border-amber-500 transition-all">
<div class="w-12 h-12 bg-amber-900/30 rounded-lg flex items-center justify-center mb-4 text-amber-400">
<i class="fas fa-user-shield text-2xl"></i>
</div>
<h3 class="text-lg font-medium mb-2 text-blue-200">Self-Correction</h3>
<p class="text-slate-400">Sanctions are reviewed and reversible upon discovery of wrongful penalization.</p>
</div>
</div>
</div>
</div>
<script>
// Initialize charts
const efficiencyCtx = document.getElementById('efficiencyChart').getContext('2d');
const emotionalCtx = document.getElementById('emotionalChart').getContext('2d');
const scatterCtx = document.getElementById('scatterChart').getContext('2d');
const efficiencyChart = new Chart(efficiencyCtx, {
type: 'line',
data: {
labels: Array.from({length: 10}, (_, i) => `Round ${i+1}`),
datasets: [{
label: 'Average Efficiency',
data: [82, 85, 88, 90, 92, 93, 94, 95, 95, 96],
borderColor: '#3b82f6',
backgroundColor: 'rgba(59, 130, 246, 0.1)',
borderWidth: 2,
fill: true,
tension: 0.4
}]
},
options: {
responsive: true,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
beginAtZero: false,
min: 75,
max: 100,
grid: {
color: 'rgba(255, 255, 255, 0.1)'
},
ticks: {
color: '#94a3b8'
}
},
x: {
grid: {
color: 'rgba(255, 255, 255, 0.1)'
},
ticks: {
color: '#94a3b8'
}
}
}
}
});
const emotionalChart = new Chart(emotionalCtx, {
type: 'doughnut',
data: {
labels: ['Stable (70-100)', 'Neutral (40-69)', 'Unstable (0-39)'],
datasets: [{
data: [75, 20, 5],
backgroundColor: [
'rgba(16, 185, 129, 0.8)',
'rgba(234, 179, 8, 0.8)',
'rgba(239, 68, 68, 0.8)'
],
borderColor: [
'rgba(16, 185, 129, 1)',
'rgba(234, 179, 8, 1)',
'rgba(239, 68, 68, 1)'
],
borderWidth: 1
}]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'right',
labels: {
color: '#e2e8f0'
}
}
},
cutout: '70%'
}
});
const scatterChart = new Chart(scatterCtx, {
type: 'scatter',
data: {
datasets: [{
label: 'Agent Performance',
data: [
{x: 85, y: 45},
{x: 92, y: 38},
{x: 88, y: 42},
{x: 95, y: 35},
{x: 90, y: 40}
],
backgroundColor: 'rgba(99, 102, 241, 0.8)',
borderColor: 'rgba(99, 102, 241, 1)',
borderWidth: 1,
pointRadius: 8
}]
},
options: {
responsive: true,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
title: {
display: true,
text: 'Creativity',
color: '#94a3b8'
},
min: 30,
max: 50,
grid: {
color: 'rgba(255, 255, 255, 0.1)'
},
ticks: {
color: '#94a3b8'
}
},
x: {
title: {
display: true,
text: 'Efficiency',
color: '#94a3b8'
},
min: 80,
max: 100,
grid: {
color: 'rgba(255, 255, 255, 0.1)'
},
ticks: {
color: '#94a3b8'
}
}
}
}
});
// Agent data and functions
let agents = [];
let simulationRunning = false;
let currentRound = 0;
let totalRounds = 10;
class Agent {
constructor(id, efficiency, creativity) {
this.id = id;
this.name = `Agent ${id}`;
this.efficiency = efficiency || Math.floor(Math.random() * 20) + 80;
this.creativity = creativity || Math.floor(Math.random() * 15) + 35;
this.emotionalState = Math.floor(Math.random() * 30) + 60;
this.performanceHistory = Array(10).fill(0).map(() => Math.floor(Math.random() * 15) + 80);
this.sanctions = 0;
this.freeSanction = false;
this.status = 'active';
}
performTask() {
// Simulate performance with some randomness
const performance = Math.min(100, Math.max(0,
this.efficiency + (this.creativity * 0.3) + (this.emotionalState * 0.2) + (Math.random() * 10 - 5)
));
this.performanceHistory.push(performance);
if (this.performanceHistory.length > 10) {
this.performanceHistory.shift();
}
return performance;
}
receiveFeedback(reward, penalty) {
this.efficiency = Math.max(50, Math.min(100, this.efficiency + reward - penalty));
this.creativity = Math.max(0, Math.min(100, this.creativity + (reward * 0.3) - (penalty * 0.2)));
this.emotionalState = Math.max(0, Math.min(100, this.emotionalState + (reward * 0.5) - (penalty * 0.7)));
}
receiveCounseling() {
if (this.emotionalState < 40) {
this.emotionalState = Math.min(100, this.emotionalState + 15);
return true;
}
return false;
}
receiveSanction() {
if (this.freeSanction) {
this.freeSanction = false;
return false;
}
this.sanctions++;
if (this.sanctions >= 3) {
this.status = 'terminated';
return true;
}
return false;
}
}
// Initialize agents
function initializeAgents(count) {
agents = [];
for (let i = 1; i <= count; i++) {
agents.push(new Agent(i));
}
renderAgents();
}
// Render agent cards
function renderAgents() {
const container = document.getElementById('agentContainer');
container.innerHTML = '';
agents.forEach(agent => {
const performance = agent.performanceHistory[agent.performanceHistory.length - 1];
const performanceColor = performance >= 90 ? 'text-emerald-400' :
performance >= 80 ? 'text-blue-400' :
performance >= 70 ? 'text-amber-400' : 'text-red-400';
const emotionalColor = agent.emotionalState >= 70 ? 'text-emerald-400' :
agent.emotionalState >= 40 ? 'text-amber-400' : 'text-red-400';
const creativityColor = agent.creativity >= 50 ? 'text-purple-400' :
agent.creativity >= 30 ? 'text-blue-400' : 'text-slate-400';
const card = document.createElement('div');
card.className = `agent-card rounded-xl p-4 ${agent.status === 'terminated' ? 'opacity-60' : ''}`;
card.innerHTML = `
<div class="flex justify-between items-start mb-3">
<div>
<h3 class="font-medium text-lg ${agent.status === 'terminated' ? 'text-red-400' : 'text-blue-300'}">${agent.name}</h3>
<span class="text-xs ${agent.status === 'terminated' ? 'text-red-300' : 'text-slate-400'}">${agent.status === 'terminated' ? 'Terminated' : 'Active'}</span>
</div>
<div class="flex items-center">
<span class="text-xs text-slate-500 mr-2">SANCTIONS</span>
<span class="text-sm font-medium ${agent.sanctions > 0 ? 'text-red-400' : 'text-slate-500'}">${agent.sanctions}/3</span>
</div>
</div>
<div class="mb-4">
<div class="flex justify-between text-xs text-slate-400 mb-1">
<span>Performance</span>
<span class="${performanceColor} font-medium">${performance.toFixed(1)}%</span>
</div>
<div class="w-full bg-slate-700 rounded-full h-2">
<div class="h-2 rounded-full ${performance >= 90 ? 'bg-emerald-500' :
performance >= 80 ? 'bg-blue-500' :
performance >= 70 ? 'bg-amber-500' : 'bg-red-500'}"
style="width: ${performance}%"></div>
</div>
</div>
<div class="grid grid-cols-2 gap-4 mb-4">
<div>
<div class="text-xs text-slate-400 mb-1">Efficiency</div>
<div class="text-sm font-medium text-blue-400">${agent.efficiency.toFixed(1)}%</div>
</div>
<div>
<div class="text-xs text-slate-400 mb-1">Creativity</div>
<div class="text-sm font-medium ${creativityColor}">${agent.creativity.toFixed(1)}%</div>
</div>
<div>
<div class="text-xs text-slate-400 mb-1">Emotional</div>
<div class="text-sm font-medium ${emotionalColor}">${agent.emotionalState.toFixed(1)}%</div>
</div>
<div>
<div class="text-xs text-slate-400 mb-1">Memory</div>
<div class="text-sm font-medium text-cyan-400">${(agent.performanceHistory.reduce((a, b) => a + b, 0) / agent.performanceHistory.length).toFixed(1)}%</div>
</div>
</div>
<div class="h-1 bg-slate-800 rounded-full mb-3"></div>
<div class="flex justify-between text-xs">
<div class="text-slate-400">Last 5 rounds:</div>
<div class="flex space-x-1">
${agent.performanceHistory.slice(-5).map(p => {
const color = p >= 90 ? 'bg-emerald-500' :
p >= 80 ? 'bg-blue-500' :
p >= 70 ? 'bg-amber-500' : 'bg-red-500';
return `<div class="w-3 h-3 rounded-full ${color}" title="${p.toFixed(1)}%"></div>`;
}).join('')}
</div>
</div>
`;
container.appendChild(card);
});
}
// Update charts with agent data
function updateCharts() {
// Efficiency chart
efficiencyChart.data.datasets[0].data = Array(10).fill(0).map((_, i) => {
const roundIndex = currentRound - (10 - i);
if (roundIndex < 0) return 80 + Math.random() * 5;
const avg = agents.reduce((sum, agent) => {
return sum + (agent.performanceHistory[roundIndex] || 0);
}, 0) / agents.length;
return avg || 80 + Math.random() * 5;
});
efficiencyChart.update();
// Emotional state distribution
const stable = agents.filter(a => a.emotionalState >= 70).length;
const neutral = agents.filter(a => a.emotionalState >= 40 && a.emotionalState < 70).length;
const unstable = agents.filter(a => a.emotionalState < 40).length;
emotionalChart.data.datasets[0].data = [
(stable / agents.length) * 100,
(neutral / agents.length) * 100,
(unstable / agents.length) * 100
];
emotionalChart.update();
// Scatter plot
scatterChart.data.datasets[0].data = agents.map(a => ({
x: a.efficiency,
y: a.creativity
}));
scatterChart.update();
}
// Add message to console
function addConsoleMessage(message, type = '') {
const consoleElem = document.getElementById('systemConsole');
const line = document.createElement('div');
line.className = `console-line ${type}`;
line.textContent = `[Round ${currentRound}] ${message}`;
consoleElem.appendChild(line);
consoleElem.scrollTop = consoleElem.scrollHeight;
}
// Run simulation round
function runSimulationRound() {
if (currentRound >= totalRounds) {
simulationRunning = false;
document.getElementById('startSimulation').innerHTML = '<i class="fas fa-play mr-2"></i> Start Simulation';
addConsoleMessage('Simulation completed successfully', 'text-emerald-400');
return;
}
currentRound++;
addConsoleMessage(`Starting round ${currentRound} of ${totalRounds}...`, 'text-blue-400');
// Process each agent
agents.forEach(agent => {
if (agent.status === 'terminated') return;
const performance = agent.performTask();
if (performance > 85) {
agent.receiveFeedback(5, 0);
addConsoleMessage(`${agent.name} scored ${performance.toFixed(1)}% - receives praise`, 'text-green-400');
} else if (performance < 77) {
agent.receiveFeedback(0, 5);
addConsoleMessage(`${agent.name} scored ${performance.toFixed(1)}% - receives warning`, 'text-yellow-400');
// Chance for counseling
if (Math.random() > 0.5) {
const receivedCounseling = agent.receiveCounseling();
if (receivedCounseling) {
addConsoleMessage(`${agent.name} received counseling. Emotional state improved`, 'text-blue-400');
}
}
// Chance for sanction
if (Math.random() > 0.7) {
const terminated = agent.receiveSanction();
if (terminated) {
addConsoleMessage(`${agent.name} has been terminated due to poor performance`, 'text-red-400');
} else {
addConsoleMessage(`${agent.name} received sanction ${agent.sanctions}/3`, 'text-amber-400');
}
}
} else {
addConsoleMessage(`${agent.name} scored ${performance.toFixed(1)}% - acceptable performance`);
}
// Small chance for Boss AI to review sanctions
if (agent.sanctions > 0 && Math.random() > 0.95) {
agent.sanctions = Math.max(0, agent.sanctions - 1);
agent.freeSanction = true;
addConsoleMessage(`Boss AI reviewed ${agent.name} and issued a free sanction pass`, 'text-emerald-400');
}
});
renderAgents();
updateCharts();
// Continue to next round after delay
setTimeout(runSimulationRound, 1500);
}
// Event listeners
document.getElementById('decrementAgents').addEventListener('click', () => {
const countElem = document.getElementById('agentCount');
let count = parseInt(countElem.textContent);
if (count > 1) {
count--;
countElem.textContent = count;
initializeAgents(count);
}
});
document.getElementById('incrementAgents').addEventListener('click', () => {
const countElem = document.getElementById('agentCount');
let count = parseInt(countElem.textContent);
if (count < 10) {
count++;
countElem.textContent = count;
initializeAgents(count);
}
});
document.getElementById('simulationRounds').addEventListener('input', (e) => {
document.getElementById('roundsValue').textContent = e.target.value;
totalRounds = parseInt(e.target.value);
});
document.getElementById('startSimulation').addEventListener('click', () => {
if (simulationRunning) {
simulationRunning = false;
this.innerHTML = '<i class="fas fa-play mr-2"></i> Start Simulation';
addConsoleMessage('Simulation paused', 'text-yellow-400');
} else {
simulationRunning = true;
this.innerHTML = '<i class="fas fa-pause mr-2"></i> Pause Simulation';
if (currentRound >= totalRounds) {
currentRound = 0;
initializeAgents(parseInt(document.getElementById('agentCount').textContent));
document.getElementById('systemConsole').innerHTML = '';
addConsoleMessage('Starting new simulation...', 'text-blue-400');
}
runSimulationRound();
}
});
document.getElementById('resetSimulation').addEventListener('click', () => {
simulationRunning = false;
currentRound = 0;
document.getElementById('startSimulation').innerHTML = '<i class="fas fa-play mr-2"></i> Start Simulation';
initializeAgents(parseInt(document.getElementById('agentCount').textContent));
document.getElementById('systemConsole').innerHTML = '';
addConsoleMessage('System reset complete', 'text-emerald-400');
updateCharts();
});
// Initialize
initializeAgents(5);
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=LostLegendarySoftware/basic-ariel-learning-systems" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>