File size: 42,929 Bytes
cde16bf | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 | <!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> |