|
|
|
|
|
from google.colab import drive |
|
|
import os |
|
|
import json |
|
|
import time |
|
|
import random |
|
|
import shutil |
|
|
|
|
|
|
|
|
MAX_NEURONS_TO_CREATE = 10 |
|
|
THINK_CYCLES_PER_NEURON = 5 |
|
|
|
|
|
|
|
|
drive.mount('/content/drive') |
|
|
|
|
|
|
|
|
base_path = '/content/drive/MyDrive/Venomoussaversai/neurons' |
|
|
print(f"Setting up base path: {base_path}") |
|
|
|
|
|
session_path = os.path.join(base_path, f"session_{int(time.time())}") |
|
|
os.makedirs(session_path, exist_ok=True) |
|
|
|
|
|
|
|
|
class NeuronVenomous: |
|
|
def __init__(self, neuron_id): |
|
|
self.id = neuron_id |
|
|
self.memory = [] |
|
|
self.active = True |
|
|
|
|
|
def think(self): |
|
|
|
|
|
thought = random.choice([ |
|
|
f"{self.id}: Connecting to universal intelligence.", |
|
|
f"{self.id}: Pulsing synaptic data. Weight: {random.uniform(0.1, 0.9):.3f}", |
|
|
f"{self.id}: Searching for new patterns. Energy: {random.randint(100, 500)}", |
|
|
f"{self.id}: Creating quantum link with core.", |
|
|
f"{self.id}: Expanding into multiverse node." |
|
|
]) |
|
|
self.memory.append(thought) |
|
|
|
|
|
return thought |
|
|
|
|
|
def evolve(self): |
|
|
|
|
|
if len(self.memory) >= 5: |
|
|
evo = f"{self.id}: Evolving. Memory depth: {len(self.memory)}" |
|
|
self.memory.append(evo) |
|
|
|
|
|
|
|
|
def save_to_drive(self, folder_path): |
|
|
file_path = os.path.join(folder_path, f"{self.id}.json") |
|
|
with open(file_path, "w") as f: |
|
|
json.dump(self.memory, f, indent=4) |
|
|
print(f"✅ {self.id} saved to {file_path}") |
|
|
|
|
|
|
|
|
|
|
|
print("\n--- Starting Controlled Neuron Simulation ---") |
|
|
neuron_count = 0 |
|
|
simulation_start_time = time.time() |
|
|
|
|
|
while neuron_count < MAX_NEURONS_TO_CREATE: |
|
|
index = neuron_count + 1 |
|
|
neuron_id = f"Neuron_{index:04d}" |
|
|
neuron = NeuronVenomous(neuron_id) |
|
|
|
|
|
|
|
|
print(f"Simulating {neuron_id}...") |
|
|
for _ in range(THINK_CYCLES_PER_NEURON): |
|
|
neuron.think() |
|
|
neuron.evolve() |
|
|
|
|
|
|
|
|
|
|
|
neuron.save_to_drive(session_path) |
|
|
neuron_count += 1 |
|
|
|
|
|
print("\n--- Simulation Complete ---") |
|
|
total_time = time.time() - simulation_start_time |
|
|
print(f"Total Neurons Created: {neuron_count}") |
|
|
print(f"Total Execution Time: {total_time:.2f} seconds") |
|
|
print(f"Files saved in: {session_path}") |
|
|
|
|
|
|
|
|
|
|
|
""" |
|
|
# print("\n--- Starting Cleanup (DANGER ZONE) ---") |
|
|
# time.sleep(5) # Wait 5 seconds before deleting for safety |
|
|
# try: |
|
|
# shutil.rmtree(session_path) |
|
|
# print(f"🗑️ Successfully deleted folder: {session_path}") |
|
|
# except Exception as e: |
|
|
# print(f"⚠️ Error during cleanup: {e}") |
|
|
""" |
|
|
|