Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
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))