diff --git a/LICENSE.md b/LICENSE.md index 1978f26..54436a3 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The Percolation.jl package is licensed under the MIT "Expat" License: -> Copyright (c) 2016: goropikari. +> Copyright (c) 2016: goropikari and contributors > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal diff --git a/Project.toml b/Project.toml new file mode 100644 index 0000000..010bf85 --- /dev/null +++ b/Project.toml @@ -0,0 +1,11 @@ +name = "Percolation" +uuid = "31b34cd4-33dc-40c1-8f72-ebe007ebca36" +authors = ["Goropikari "] +version = "0.1.0" + +[deps] +Gtk = "4c0ca9eb-093a-5379-98c5-f87ac0bbbf44" +Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0" +Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" diff --git a/example/percolation_example.jl b/example/percolation_example.jl new file mode 100644 index 0000000..e4807c5 --- /dev/null +++ b/example/percolation_example.jl @@ -0,0 +1,18 @@ +using Percolation + +N = 50; p = 0.6 +sq = Square(N, p, "nn") +sq.lattice_config.lattice_sites + +label_components!(sq) +sq.lattice_properties.labeled_lattice_sites + +sq +heatmap!(sq) + +linsize = 50 +ps = 0.1 +pinc = 0.025 +pf = 1 +nsample = 50 +plot_percolation_prob("square", linsize, ps, pinc, pf, nsample) \ No newline at end of file diff --git a/src/Percolation.jl b/src/Percolation.jl index f42cc88..87b960d 100644 --- a/src/Percolation.jl +++ b/src/Percolation.jl @@ -1,6 +1,6 @@ module Percolation -using Gtk, Gtk.ShortNames, StatsBase, Plots +using Gtk, Gtk.ShortNames, StatsBase, Plots, Random gr() import Plots: heatmap, heatmap! import Images: label_components, label_components! diff --git a/src/latticetype.jl b/src/latticetype.jl index 1b6545b..906d748 100644 --- a/src/latticetype.jl +++ b/src/latticetype.jl @@ -79,7 +79,7 @@ for lattice_type in lattice_types false, # isaverage_clustersize false, # isstrength 0, # nclusters - Matrix{Int}(linear_size, linear_size) # labeled_lattice_sites + Array{Int64,2}(undef,linear_size, linear_size) # labeled_lattice_sites ) ) end