Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
46 lines (32 sloc) 1.05 KB
import numpy as np
static_graph = "sample.gr"
temporal_graph = "sample_t.gr"
time_step = 1
temporal_edges = 10
spatial_partition = 2
temporal_partition = 2
p = 3 # Vary from 0-100
def prob_distribution_1():
mu, sigma = 0, 10
return np.random.normal(mu, sigma)
def prob_distribution_2():
mu, sigma = 0, 8
return np.random.normal(mu, sigma)
def prob_distribution_3():
mu, sigma = 0, 9
return np.random.normal(mu, sigma)
def prob_distribution_4():
mu, sigma = 0, 8
return np.random.normal(mu, sigma)
prob_distributions = [prob_distribution_1, prob_distribution_2, prob_distribution_3, prob_distribution_4]
def get_node_set(node):
return node % spatial_partition
def get_time_set(time_instant):
return time_instant % temporal_partition
def custom_distribution(node, time_instant):
s = get_node_set(node)
t = get_time_set(time_instant)
index = s*spatial_partition + t
return np.abs(prob_distributions[index]())
sample_from_distribution = custom_distribution
#print(sample_from_distribution(1,1))
You can’t perform that action at this time.