Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
553f433
Added type functions, general heuristics and metagraph
Sep 2, 2020
11383ca
Merge branch 'master' into node_types
luap-pik Sep 3, 2020
c352160
some small fixes
luap-pik Sep 3, 2020
3c9c532
Merge branch 'master' into node_types
luap-pik Sep 3, 2020
edb0c11
resolve -> mainfest
luap-pik Sep 3, 2020
0bbed77
Fixed heuristics functions. Added specific maximum value methods for …
Sep 3, 2020
558fa37
some comments
luap-pik Sep 3, 2020
7b5e56a
return boolean from method_arr
luap-pik Sep 4, 2020
95a908f
apllied auto-formatting
luap-pik Sep 4, 2020
18c7a51
Merge branch 'master' into node_types
luap-pik Sep 4, 2020
a1a908d
Made changes to steps G3,G4.
Sep 4, 2020
43645f6
Changes to G3,G4
Sep 4, 2020
c694584
test
luap-pik Sep 6, 2020
70b1c36
Merge branch 'master' into node_types
luap-pik Sep 6, 2020
5c10eb3
Merge branch 'master' into node_types
luap-pik Sep 6, 2020
049f154
Minor changes
Sep 18, 2020
2558f8b
New struct NodeType added. Has properties name, probability and metho…
Sep 28, 2020
9bf1f01
Implemented different probabilities for connections between different…
Sep 29, 2020
713e1be
Implemented node type connection probabilities
Oct 5, 2020
83010a3
Minor changes
Oct 29, 2020
2a1b97f
Changed heurstics implementation.
Oct 30, 2020
c52dc76
Added degree distribution and a simplified version of neighbour proba…
Dec 11, 2020
eb0ce50
Added a check for already connected nodes in G34. Removed the step ch…
Dec 16, 2020
0361833
fixed merge conflict
Jan 26, 2021
20cd5cf
Fixed some bugs: 1) added checks to avoid self-edges and multi-edges …
Jan 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ docs/build/
docs/site/
.vscode/
Manifest.toml

2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
EmbeddedGraphs = "9c1af47c-29f5-11e9-0b47-9f5334384f20"
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
MetaGraphs = "626554b9-1ddb-594c-aa3c-2596fe9399a5"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SpatialIndexing = "d4ead438-fe20-5cc5-a293-4fd39a41b74c"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Expand Down
21 changes: 21 additions & 0 deletions src/NodeTypes.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""For the incorporation of different node types to SyntheticNetworks package."""

struct NodeType
name::String
probability::Float32
neighbor_probability::Dict # Dict(Symbol(NodeType_i.name) => prob)
method_parameter
end

NodeType() = NodeType("Node", 1., Dict(:Node => 1.), 0)

""" From a list of probabilities of drawing a node type, determines one randomly and
returns the index of node type"""
function draw_type(node_types::Array{NodeType,1})
prob = map(x -> x.probability, node_types)
t0 = copy(prob)
pushfirst!(t0 , 0.)
type_interval = [sum(t0[1:i+1]) for i in 1:length(t0)-1]
t_n = findfirst(type_interval .>= rand())
return node_types[t_n]
end
Loading