Posts

Spiral Dynamics Optimization

Image
Spiral Dynamics Inspired Optimization ¶ Kenichi Tamura and Keiichiro Yasuda ¶ https://doi.org/10.20965/jaciii.2011.p1116 ¶ Ilustration ¶ In [1]: import math import numpy as np import copy import random import time import datetime import itertools import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D Rotation Model ¶ Rotation 2D ¶ In [2]: def x_rotate ( x , radius = 0.95 , theta = math . pi / 3 ): rotate_m = radius * np . array ([[ math . cos ( theta ), - math . sin ( theta )],[ math . sin ( theta ), math . cos ( theta )]]) return rotate_m @x def xvec_rotate ( xvec , center = [ 0 , 0 ], n = 10 , radius = 0.95 , theta =- math . pi / 3 ): rotate_m = radius * np . array ([[ math . co...