{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "┌ Warning: `setindex!(df::DataFrame, v::AbstractVector, col_ind::ColumnIndex)` is deprecated, use `begin\n", "│ df[!, col_ind] = v\n", "│ df\n", "│ end` instead.\n", "│ caller = top-level scope at Experiment.jl:25 [inlined]\n", "└ @ Core /home/jake/project/beef-o-bradys-state-space-search/Experiment.jl:25\n" ] }, { "data": { "text/plain": [ "main (generic function with 1 method)" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "include(\"Experiment.jl\")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "4" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "POPSIZE = 6\n", "mu = 2\n", "lambda = 4\n", "TARGETCALORIES = 2500\n", "CANDIDATESIZE = 4" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "┌ Warning: `getindex(df::DataFrame, col_ind::ColumnIndex)` is deprecated, use `df[!, col_ind]` instead.\n", "│ caller = fitness(::DataFrames.DataFrame) at Experiment.jl:67\n", "└ @ Main /home/jake/project/beef-o-bradys-state-space-search/Experiment.jl:67\n" ] }, { "data": { "text/plain": [ "Dict{Integer,Float64} with 11 entries:\n", " 2 => 20.0\n", " 11 => 20.0\n", " 7 => 20.0\n", " 9 => 20.0\n", " 10 => 20.0\n", " 8 => 20.0\n", " 6 => 20.0\n", " 4 => 20.0\n", " 3 => 20.0\n", " 5 => 20.0\n", " 1 => 50.0" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "main(10)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "OrderedCollections.OrderedDict{Integer,Float64} with 21 entries:\n", " 1 => 150.0\n", " 2 => 150.0\n", " 3 => 150.0\n", " 4 => 10.0\n", " 5 => 10.0\n", " 6 => 10.0\n", " 7 => 10.0\n", " 8 => 10.0\n", " 9 => 10.0\n", " 10 => 10.0\n", " 11 => 10.0\n", " 12 => 10.0\n", " 13 => 10.0\n", " 14 => 0.0\n", " 15 => 0.0\n", " 16 => 0.0\n", " 17 => 0.0\n", " 18 => 0.0\n", " 19 => 0.0\n", " 20 => 0.0\n", " 21 => 0.0" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "using Plots\n", "res = main(20)\n", "res = sort(res)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Results\n", "Shown by tweaking the parameters of popsize, mu, lambda, targetcalories, and candidatesize.\n", "\n", "## Gadfly\n", "Julia plotting library based on Grammar of Graphics." ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "5\n", "\n", "\n", "10\n", "\n", "\n", "15\n", "\n", "\n", "20\n", "\n", "\n", "0\n", "\n", "\n", "50\n", "\n", "\n", "100\n", "\n", "\n", "150\n", "\n", "\n", "\n", "\n", "\n", "\n", "y1\n", "\n", "\n" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "plot(collect(keys(res)), collect(values(res)))\n", "xlabel!()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Julia 1.0.3", "language": "julia", "name": "julia-1.0" }, "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", "version": "1.0.3" } }, "nbformat": 4, "nbformat_minor": 2 }