diff --git a/src/Particle.jl b/src/Particle.jl index cfcb3da..0cf59cf 100644 --- a/src/Particle.jl +++ b/src/Particle.jl @@ -1,3 +1,5 @@ +using StaticArrays: SVector + mutable struct Particle id::Int64 diff --git a/src/ReCo.jl b/src/ReCo.jl index ae653d0..abfec8f 100644 --- a/src/ReCo.jl +++ b/src/ReCo.jl @@ -11,15 +11,6 @@ export init_sim, OriginCompassEnv, COMCompassEnv -using StaticArrays: SVector -using JLD2: JLD2 -using Distributions: Uniform, Normal -using ProgressMeter: ProgressMeter -using CellListMap: CellListMap - -using Random: Random -using Dates: Dates - include("Error.jl") using .Error diff --git a/src/Shape.jl b/src/Shape.jl index efc0451..f1864b4 100644 --- a/src/Shape.jl +++ b/src/Shape.jl @@ -1,5 +1,7 @@ module Shape +using StaticArrays: SVector + export center_of_mass, gyration_tensor_eigvals_ratio, gyration_tensor_eigvecs, elliptical_distance diff --git a/src/data.jl b/src/data.jl index 0e61f88..0f8b601 100644 --- a/src/data.jl +++ b/src/data.jl @@ -1,3 +1,6 @@ +using Dates: Dates +using JLD2: JLD2 + struct SimConsts n_particles::Int64 v₀::Float64 diff --git a/src/run.jl b/src/run.jl index 1b02ca9..d41fead 100644 --- a/src/run.jl +++ b/src/run.jl @@ -1,3 +1,9 @@ +using CellListMap: CellListMap +using Dates: Dates +using JLD2: JLD2 +using Random: Random +using StaticArrays: SVector + const DEFAULT_SNAPSHOT_AT = 0.1 const DEFAULT_SEED = 42 const DEFAULT_N_BUNDLE_SNAPSHOTS = 100 diff --git a/src/setup.jl b/src/setup.jl index 3d6e10e..368b0b6 100644 --- a/src/setup.jl +++ b/src/setup.jl @@ -1,3 +1,8 @@ +using Dates: Dates +using Distributions: Uniform +using JLD2: JLD2 +using StaticArrays: SVector + const DEFAULT_PACKING_FRACTION = 0.5 const DEFAULT_δt = 1e-5 const DEFAULT_SKIN_TO_INTERACTION_RADIUS_RATIO = 3.0 diff --git a/src/simulation.jl b/src/simulation.jl index 1c93479..63f071a 100644 --- a/src/simulation.jl +++ b/src/simulation.jl @@ -1,3 +1,8 @@ +using Distributions: Normal +using ProgressMeter: ProgressMeter +using StaticArrays: SVector +using CellListMap: CellListMap + function rand_normal01() return rand(Normal(0, 1)) end diff --git a/visualization/Animation.jl b/visualization/Animation.jl index 65edfec..ae63461 100644 --- a/visualization/Animation.jl +++ b/visualization/Animation.jl @@ -54,12 +54,13 @@ function animate_bundle!(args, sim_consts::ReCo.SimConsts) end if args.n_bundle == 1 && bundle_snapshot == 1 + println("OK") scatter!( args.ax, args.particle_xs, args.particle_ys; markersize=2 * sim_consts.particle_radius, - markerspace=SceneSpace, + markerspace=:data, color=args.particle_colors, ) @@ -68,7 +69,7 @@ function animate_bundle!(args, sim_consts::ReCo.SimConsts) args.ax, args.center_of_mass_point; markersize=6 * sim_consts.particle_radius, - markerspace=SceneSpace, + markerspace=:data, color=ColorSchemes.ColorTypes.RGBA(1.0, 1.0, 1.0, 0.6), ) end @@ -79,7 +80,7 @@ function animate_bundle!(args, sim_consts::ReCo.SimConsts) args.particle_xs, args.particle_ys; markersize=2 * sim_consts.interaction_radius, - markerspace=SceneSpace, + markerspace=:data, color=args.interaction_colors, ) end @@ -90,7 +91,7 @@ function animate_bundle!(args, sim_consts::ReCo.SimConsts) args.particle_xs, args.particle_ys; markersize=2 * sim_consts.skin_radius, - markerspace=SceneSpace, + markerspace=:data, color=args.skin_colors, ) end diff --git a/visualization/Manifest.toml b/visualization/Manifest.toml index 510dbe2..73101ff 100644 --- a/visualization/Manifest.toml +++ b/visualization/Manifest.toml @@ -142,9 +142,9 @@ version = "1.44.6" [[deps.ChainRulesCore]] deps = ["Compat", "LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "dc4405cee4b2fe9e1108caec2d760b7ea758eca2" +git-tree-sha1 = "e7ff6cadf743c098e08fca25c91103ee4303c9bb" uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "1.15.5" +version = "1.15.6" [[deps.ChangesOfVariables]] deps = ["ChainRulesCore", "LinearAlgebra", "Test"] @@ -274,10 +274,10 @@ uuid = "b429d917-457f-4dbc-8f4c-0cc954292b1d" version = "0.4.0" [[deps.DiffResults]] -deps = ["StaticArrays"] -git-tree-sha1 = "c18e98cba888c6c25d1c3b048e4b3380ca956805" +deps = ["StaticArraysCore"] +git-tree-sha1 = "782dd5f4561f5d267313f23853baaaa4c52ea621" uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" -version = "1.0.3" +version = "1.1.0" [[deps.DiffRules]] deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"] @@ -291,9 +291,9 @@ uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" [[deps.Distributions]] deps = ["ChainRulesCore", "DensityInterface", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns", "Test"] -git-tree-sha1 = "70e9677e1195e7236763042194e3fbf147fdb146" +git-tree-sha1 = "0d7d213133d948c56e8c2d9f4eab0293491d8e4a" uuid = "31c24e10-a181-5473-b8eb-7969acd0382f" -version = "0.25.74" +version = "0.25.75" [[deps.DocStringExtensions]] deps = ["LibGit2"] @@ -1062,9 +1062,9 @@ version = "0.5.11" [[deps.Pango_jll]] deps = ["Artifacts", "Cairo_jll", "Fontconfig_jll", "FreeType2_jll", "FriBidi_jll", "Glib_jll", "HarfBuzz_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "3a121dfbba67c94a5bec9dde613c3d0cbcf3a12b" +git-tree-sha1 = "84a314e3926ba9ec66ac097e3635e270986b0f10" uuid = "36c8627f-9965-5494-a995-c6b170f724f3" -version = "1.50.3+0" +version = "1.50.9+0" [[deps.Parameters]] deps = ["OrderedCollections", "UnPack"] @@ -1172,7 +1172,7 @@ version = "0.4.3" [[deps.ReCo]] deps = ["CellListMap", "Dates", "Distributions", "Flux", "Intervals", "JLD2", "LaTeXStrings", "LinearAlgebra", "ProgressMeter", "Random", "ReinforcementLearning", "StaticArrays", "UnicodePlots"] -git-tree-sha1 = "1b8333b6d62808072ef0d54a90eddd85ad557193" +git-tree-sha1 = "871954c9b32431f0c8fe3daa20302cdebdf5ad07" repo-rev = "main" repo-url = "https://gitlab.rlp.net/mobitar/ReCo.jl" uuid = "b25f7548-fcc9-4c91-bc24-841b54f4dd54" @@ -1354,14 +1354,14 @@ version = "0.7.7" [[deps.StaticArrays]] deps = ["LinearAlgebra", "Random", "StaticArraysCore", "Statistics"] -git-tree-sha1 = "efa8acd030667776248eabb054b1836ac81d92f0" +git-tree-sha1 = "2189eb2c1f25cb3f43e5807f26aa864052e50c17" uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.5.7" +version = "1.5.8" [[deps.StaticArraysCore]] -git-tree-sha1 = "ec2bd695e905a3c755b33026954b119ea17f2d22" +git-tree-sha1 = "6b7ba252635a5eff6a0b0664a41ee140a1c9e72a" uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" -version = "1.3.0" +version = "1.4.0" [[deps.Statistics]] deps = ["LinearAlgebra", "SparseArrays"] diff --git a/visualization/SnapshotPlot.jl b/visualization/SnapshotPlot.jl index ee055f2..7c5837a 100644 --- a/visualization/SnapshotPlot.jl +++ b/visualization/SnapshotPlot.jl @@ -91,7 +91,7 @@ function plot_snapshot( particle_xs, particle_ys; markersize=2 * sim_consts.particle_radius, - markerspace=SceneSpace, + markerspace=:data, color=particle_colors, ) @@ -100,7 +100,7 @@ function plot_snapshot( ax, Point(center_of_mass); markersize=6 * sim_consts.particle_radius, - markerspace=SceneSpace, + markerspace=:data, color=ColorSchemes.ColorTypes.RGBA(0.0, 0.0, 0.0, 0.6), ) end