Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

Latest commit

 

History

History
94 lines (83 loc) · 3.08 KB

File metadata and controls

94 lines (83 loc) · 3.08 KB

Project log

Package Creation

  • created src LICENSE README.md
  • opened julia
    • ; key to switch to bash
    • Pkg command to handle package management
    • 1 + 1 = 2
  • Pkg.update()
  • Pkg.generate("particle-swarm-optimization","GPL3")
    • failed -> Use the PkgDev package instead
  • Pkg.add("PkgDev")
  • PkgDev.generate("particle-swarm-optimization","GPL3")
    • failed -> GPL3 is not a known license choice
  • PkgDev.generate("particle-swarm-optimization","GPL-3.0+")
    • wrong packaging name format
  • renamed repo 😩
  • PkgDev.generate("ParticleSwarmOptimization","GPL-3.0+")
    • created new empty package 👌
  • Abandon old project workspace move to the one installed in Julia
  • It automatically commits initial changes
  • Had to overwrite git changes -> fresh history

Splitting Project into sections

  • Initial files to organise
  • Plan to use folders if these need further breaking up
  • In julia:
    • Ran Pkg.build("ParticleSwarmOptimization")
    • Ran Pkg.add("ParticleSwarmOptimization")
    • Ran using ParticleSwarmOptimization ERROR
  • Module PlotlyJS not found in current path.
  • Run Pkg.add("PlotlyJS")segfault 😕
  • Exit julia and retry
  • Run Pkg.update() ParticleSwarmOptimization: skipping update (dirty)...
  • ... Some errors later ...
  • Rebuilt
    • Rmath
  • Ran tests which passed
  • Needed to install Electron for graphing
    • Blink.AtomShell.install()
  • Graphing works but now need to put ParticleSwarmOptimization. for every method externally used
  • Solution was to add an alias lines
    • PSO = ParticleSwarmOptimization
  • Tests and simple use case now work 👍
  • julia> Pkg.build("ParticleSwarmOptimization");Pkg.test("ParticleSwarmOptimization")

Running an example use case

$ julia
> # we can print the usecase file
> for ln in eachline(open("test/test_simple.jl")) print("$ln") end
> # We can then load the example
> include("test/test_simple.jl")
> # We can then run it
> examplePSO()
> # this will bring up a plot of before and after of a PSO run
> exit()

Getting some more serious testing

  • Added some test files to expand on
    • include("test_fitness.jl")
    • include("test_helper.jl")
    • include("test_initialisation.jl")
    • include("test_movement.jl")
    • include("test_negative.jl")
    • include("test_plot.jl")
    • include("test_scenarios.jl")
    • include("test_stress.jl")
    • include("test_types.jl")

Debugging

  • It is painful to debug julia code
  • Very verbose

Removing XY

  • Made XY Swarm an example rather than the primary

To get this package installed natively

Pkg.clone("git://github.com/tylerhale/ParticleSwarmOptimization.jl.git")