This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Game of life generated by Claude3-Opus | |
(ns game-of-life.core | |
(:require [clojure.string :as str]) | |
(:gen-class)) | |
(def rows 50) | |
(def cols 50) | |
(def steps 100) | |
(defn create-board [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
class Agent: | |
longitudinal_buffer = 2. | |
a_pass = 0.1 | |
def __init__(self, agent_id, state, yield_intention=0.5, cooperative=True): | |
self.state = state.astype(float) | |
self.yield_intention = yield_intention |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import taichi as ti | |
import numpy as np | |
import time | |
from matplotlib import pyplot as plt | |
from tqdm import tqdm | |
# Set the taichi mode to "cuda" or "cpu" | |
ti.init(ti.cuda, random_seed=int(time.time())) | |
# Constants for the CEM solver | |
POPULATION_SIZE = 4096 # Number of samples in each iteration | |
ELITE_PERCENTAGE = 0.002 # Percentage of top samples to keep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2020-10-03T07:30:27.867Z","extensionVersion":"v3.4.3"} |