Skip to content

Instantly share code, notes, and snippets.

View arneschreuder's full-sized avatar
:octocat:
loading...

Arné Schreuder arneschreuder

:octocat:
loading...
View GitHub Profile
@arneschreuder
arneschreuder / mcoo.py
Created December 23, 2018 09:29
An implementation of Monte Carlo Octree Optimisation
import math
import numpy as np
import matplotlib.pyplot as plt
# Optimisation functions
# Polynomial
# def f(x):
# return np.sum(x**2)
# Ackley
@arneschreuder
arneschreuder / GBestPSO.py
Last active December 7, 2018 08:38
Global Best Particle Swarm Optimisation (PSO) in 100 lines of Python code.
# IMPORTS
from random import uniform
from copy import deepcopy
# TUNABLE CONSTANTS
swarm_size = 10
w = 0.729844
c1 = 1.496180
c2 = 1.496180