Skip to content

Instantly share code, notes, and snippets.

{"nbformat_minor": 0, "cells": [{"execution_count": 1, "cell_type": "code", "source": "# ------------------------------------------------------------------------------\n# A generic type of a evaluated member of a population\nimmutable Member\n objectives::Vector{Float64}\n variables::Vector{Float64}\nend\n\ntypealias Population Vector{Member}\n# ------------------------------------------------------------------------------", "outputs": [{"execution_count": 1, "output_type": "execute_result", "data": {"text/plain": "Array{Member,1}"}, "metadata": {}}], "metadata": {"collapsed": false, "trusted": true}}, {"execution_count": 2, "cell_type": "code", "source": "# ==============================================================================\n# Sorting Algorithms\n#\n# Overloading the sorting algorithms to work with the population type.\n# ------------------------------------------------------------------------------\nfunction Base.sortperm(p::Population, obj_types::Vector{Float64})\n pop_size = length(p)\