mirror of
https://gitlab.rlp.net/mobitar/ReCo.jl.git
synced 2024-12-27 01:11:04 +00:00
Fix markerspace
This commit is contained in:
parent
29536ab5f5
commit
475c496b31
10 changed files with 44 additions and 29 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
using StaticArrays: SVector
|
||||||
|
|
||||||
mutable struct Particle
|
mutable struct Particle
|
||||||
id::Int64
|
id::Int64
|
||||||
|
|
||||||
|
|
|
@ -11,15 +11,6 @@ export init_sim,
|
||||||
OriginCompassEnv,
|
OriginCompassEnv,
|
||||||
COMCompassEnv
|
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")
|
include("Error.jl")
|
||||||
using .Error
|
using .Error
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
module Shape
|
module Shape
|
||||||
|
|
||||||
|
using StaticArrays: SVector
|
||||||
|
|
||||||
export center_of_mass,
|
export center_of_mass,
|
||||||
gyration_tensor_eigvals_ratio, gyration_tensor_eigvecs, elliptical_distance
|
gyration_tensor_eigvals_ratio, gyration_tensor_eigvecs, elliptical_distance
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
using Dates: Dates
|
||||||
|
using JLD2: JLD2
|
||||||
|
|
||||||
struct SimConsts
|
struct SimConsts
|
||||||
n_particles::Int64
|
n_particles::Int64
|
||||||
v₀::Float64
|
v₀::Float64
|
||||||
|
|
|
@ -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_SNAPSHOT_AT = 0.1
|
||||||
const DEFAULT_SEED = 42
|
const DEFAULT_SEED = 42
|
||||||
const DEFAULT_N_BUNDLE_SNAPSHOTS = 100
|
const DEFAULT_N_BUNDLE_SNAPSHOTS = 100
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
using Dates: Dates
|
||||||
|
using Distributions: Uniform
|
||||||
|
using JLD2: JLD2
|
||||||
|
using StaticArrays: SVector
|
||||||
|
|
||||||
const DEFAULT_PACKING_FRACTION = 0.5
|
const DEFAULT_PACKING_FRACTION = 0.5
|
||||||
const DEFAULT_δt = 1e-5
|
const DEFAULT_δt = 1e-5
|
||||||
const DEFAULT_SKIN_TO_INTERACTION_RADIUS_RATIO = 3.0
|
const DEFAULT_SKIN_TO_INTERACTION_RADIUS_RATIO = 3.0
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
using Distributions: Normal
|
||||||
|
using ProgressMeter: ProgressMeter
|
||||||
|
using StaticArrays: SVector
|
||||||
|
using CellListMap: CellListMap
|
||||||
|
|
||||||
function rand_normal01()
|
function rand_normal01()
|
||||||
return rand(Normal(0, 1))
|
return rand(Normal(0, 1))
|
||||||
end
|
end
|
||||||
|
|
|
@ -54,12 +54,13 @@ function animate_bundle!(args, sim_consts::ReCo.SimConsts)
|
||||||
end
|
end
|
||||||
|
|
||||||
if args.n_bundle == 1 && bundle_snapshot == 1
|
if args.n_bundle == 1 && bundle_snapshot == 1
|
||||||
|
println("OK")
|
||||||
scatter!(
|
scatter!(
|
||||||
args.ax,
|
args.ax,
|
||||||
args.particle_xs,
|
args.particle_xs,
|
||||||
args.particle_ys;
|
args.particle_ys;
|
||||||
markersize=2 * sim_consts.particle_radius,
|
markersize=2 * sim_consts.particle_radius,
|
||||||
markerspace=SceneSpace,
|
markerspace=:data,
|
||||||
color=args.particle_colors,
|
color=args.particle_colors,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -68,7 +69,7 @@ function animate_bundle!(args, sim_consts::ReCo.SimConsts)
|
||||||
args.ax,
|
args.ax,
|
||||||
args.center_of_mass_point;
|
args.center_of_mass_point;
|
||||||
markersize=6 * sim_consts.particle_radius,
|
markersize=6 * sim_consts.particle_radius,
|
||||||
markerspace=SceneSpace,
|
markerspace=:data,
|
||||||
color=ColorSchemes.ColorTypes.RGBA(1.0, 1.0, 1.0, 0.6),
|
color=ColorSchemes.ColorTypes.RGBA(1.0, 1.0, 1.0, 0.6),
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
@ -79,7 +80,7 @@ function animate_bundle!(args, sim_consts::ReCo.SimConsts)
|
||||||
args.particle_xs,
|
args.particle_xs,
|
||||||
args.particle_ys;
|
args.particle_ys;
|
||||||
markersize=2 * sim_consts.interaction_radius,
|
markersize=2 * sim_consts.interaction_radius,
|
||||||
markerspace=SceneSpace,
|
markerspace=:data,
|
||||||
color=args.interaction_colors,
|
color=args.interaction_colors,
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
@ -90,7 +91,7 @@ function animate_bundle!(args, sim_consts::ReCo.SimConsts)
|
||||||
args.particle_xs,
|
args.particle_xs,
|
||||||
args.particle_ys;
|
args.particle_ys;
|
||||||
markersize=2 * sim_consts.skin_radius,
|
markersize=2 * sim_consts.skin_radius,
|
||||||
markerspace=SceneSpace,
|
markerspace=:data,
|
||||||
color=args.skin_colors,
|
color=args.skin_colors,
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -142,9 +142,9 @@ version = "1.44.6"
|
||||||
|
|
||||||
[[deps.ChainRulesCore]]
|
[[deps.ChainRulesCore]]
|
||||||
deps = ["Compat", "LinearAlgebra", "SparseArrays"]
|
deps = ["Compat", "LinearAlgebra", "SparseArrays"]
|
||||||
git-tree-sha1 = "dc4405cee4b2fe9e1108caec2d760b7ea758eca2"
|
git-tree-sha1 = "e7ff6cadf743c098e08fca25c91103ee4303c9bb"
|
||||||
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
|
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
|
||||||
version = "1.15.5"
|
version = "1.15.6"
|
||||||
|
|
||||||
[[deps.ChangesOfVariables]]
|
[[deps.ChangesOfVariables]]
|
||||||
deps = ["ChainRulesCore", "LinearAlgebra", "Test"]
|
deps = ["ChainRulesCore", "LinearAlgebra", "Test"]
|
||||||
|
@ -274,10 +274,10 @@ uuid = "b429d917-457f-4dbc-8f4c-0cc954292b1d"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
|
|
||||||
[[deps.DiffResults]]
|
[[deps.DiffResults]]
|
||||||
deps = ["StaticArrays"]
|
deps = ["StaticArraysCore"]
|
||||||
git-tree-sha1 = "c18e98cba888c6c25d1c3b048e4b3380ca956805"
|
git-tree-sha1 = "782dd5f4561f5d267313f23853baaaa4c52ea621"
|
||||||
uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5"
|
uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5"
|
||||||
version = "1.0.3"
|
version = "1.1.0"
|
||||||
|
|
||||||
[[deps.DiffRules]]
|
[[deps.DiffRules]]
|
||||||
deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"]
|
deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"]
|
||||||
|
@ -291,9 +291,9 @@ uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
|
||||||
|
|
||||||
[[deps.Distributions]]
|
[[deps.Distributions]]
|
||||||
deps = ["ChainRulesCore", "DensityInterface", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns", "Test"]
|
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"
|
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
|
||||||
version = "0.25.74"
|
version = "0.25.75"
|
||||||
|
|
||||||
[[deps.DocStringExtensions]]
|
[[deps.DocStringExtensions]]
|
||||||
deps = ["LibGit2"]
|
deps = ["LibGit2"]
|
||||||
|
@ -1062,9 +1062,9 @@ version = "0.5.11"
|
||||||
|
|
||||||
[[deps.Pango_jll]]
|
[[deps.Pango_jll]]
|
||||||
deps = ["Artifacts", "Cairo_jll", "Fontconfig_jll", "FreeType2_jll", "FriBidi_jll", "Glib_jll", "HarfBuzz_jll", "JLLWrappers", "Libdl", "Pkg"]
|
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"
|
uuid = "36c8627f-9965-5494-a995-c6b170f724f3"
|
||||||
version = "1.50.3+0"
|
version = "1.50.9+0"
|
||||||
|
|
||||||
[[deps.Parameters]]
|
[[deps.Parameters]]
|
||||||
deps = ["OrderedCollections", "UnPack"]
|
deps = ["OrderedCollections", "UnPack"]
|
||||||
|
@ -1172,7 +1172,7 @@ version = "0.4.3"
|
||||||
|
|
||||||
[[deps.ReCo]]
|
[[deps.ReCo]]
|
||||||
deps = ["CellListMap", "Dates", "Distributions", "Flux", "Intervals", "JLD2", "LaTeXStrings", "LinearAlgebra", "ProgressMeter", "Random", "ReinforcementLearning", "StaticArrays", "UnicodePlots"]
|
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-rev = "main"
|
||||||
repo-url = "https://gitlab.rlp.net/mobitar/ReCo.jl"
|
repo-url = "https://gitlab.rlp.net/mobitar/ReCo.jl"
|
||||||
uuid = "b25f7548-fcc9-4c91-bc24-841b54f4dd54"
|
uuid = "b25f7548-fcc9-4c91-bc24-841b54f4dd54"
|
||||||
|
@ -1354,14 +1354,14 @@ version = "0.7.7"
|
||||||
|
|
||||||
[[deps.StaticArrays]]
|
[[deps.StaticArrays]]
|
||||||
deps = ["LinearAlgebra", "Random", "StaticArraysCore", "Statistics"]
|
deps = ["LinearAlgebra", "Random", "StaticArraysCore", "Statistics"]
|
||||||
git-tree-sha1 = "efa8acd030667776248eabb054b1836ac81d92f0"
|
git-tree-sha1 = "2189eb2c1f25cb3f43e5807f26aa864052e50c17"
|
||||||
uuid = "90137ffa-7385-5640-81b9-e52037218182"
|
uuid = "90137ffa-7385-5640-81b9-e52037218182"
|
||||||
version = "1.5.7"
|
version = "1.5.8"
|
||||||
|
|
||||||
[[deps.StaticArraysCore]]
|
[[deps.StaticArraysCore]]
|
||||||
git-tree-sha1 = "ec2bd695e905a3c755b33026954b119ea17f2d22"
|
git-tree-sha1 = "6b7ba252635a5eff6a0b0664a41ee140a1c9e72a"
|
||||||
uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
|
uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
|
||||||
version = "1.3.0"
|
version = "1.4.0"
|
||||||
|
|
||||||
[[deps.Statistics]]
|
[[deps.Statistics]]
|
||||||
deps = ["LinearAlgebra", "SparseArrays"]
|
deps = ["LinearAlgebra", "SparseArrays"]
|
||||||
|
|
|
@ -91,7 +91,7 @@ function plot_snapshot(
|
||||||
particle_xs,
|
particle_xs,
|
||||||
particle_ys;
|
particle_ys;
|
||||||
markersize=2 * sim_consts.particle_radius,
|
markersize=2 * sim_consts.particle_radius,
|
||||||
markerspace=SceneSpace,
|
markerspace=:data,
|
||||||
color=particle_colors,
|
color=particle_colors,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ function plot_snapshot(
|
||||||
ax,
|
ax,
|
||||||
Point(center_of_mass);
|
Point(center_of_mass);
|
||||||
markersize=6 * sim_consts.particle_radius,
|
markersize=6 * sim_consts.particle_radius,
|
||||||
markerspace=SceneSpace,
|
markerspace=:data,
|
||||||
color=ColorSchemes.ColorTypes.RGBA(0.0, 0.0, 0.0, 0.6),
|
color=ColorSchemes.ColorTypes.RGBA(0.0, 0.0, 0.0, 0.6),
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue