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 | |
from collections.abc import Sized, Iterable, Iterator | |
from itertools import product, count, combinations, permutations | |
from collections import defaultdict | |
from typing import Optional | |
import cycosat | |
BlocksColor = [ | |
'#ffb631', | |
'#f0ea4b', |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
ti.init(arch=ti.gpu) | |
StatusSearch, StatusAtFood, StatusGoHome, StatusAtHome = 1, 2, 3, 4 | |
pi = 3.1415926 | |
width = 80 | |
height = 60 | |
N = 1000 | |
ant_length = 1 |
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 | |
Category10_10 = ('#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', | |
'#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf') | |
ti.init(arch=ti.gpu) | |
N = 2000 | |
N_COLOR = 10 | |
COLORS = [int(c[1:], 16) for c in Category10_10] |
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
from kiwisolver import strength | |
import taichi as ti | |
import numpy as np | |
Category10_10 = ('#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf') | |
ti.init(arch=ti.gpu) | |
N = 5000 | |
N_COLOR = 10 |
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
. ....... .......,,,.......*(* /%/ | |
.. . .... .,,... .*//, /&/ | |
... ... ....,,,,,,,,. ,*//, /&/ | |
.. .....,,,,.*/*,. *%* | |
. .. ..,,,*,,. *(, | |
..... ..,*,,.. *#* | |
..,***,. *#* | |
.,*(*,. *%/. | |
. .,/#* *(*. | |
.. .,**,**, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from scipy import integrate | |
import numpy as np | |
def spring_sys(t, y, m, b, k, F): | |
x, v = y | |
dx = v | |
dv = (F - k * x - b * v) / m | |
return dx, dv | |
def run_sim(x0, v0, m, b, k, F, tend, n): |
NewerOlder