Exemplo n.º 1
0
        for j in range(last_index, len(time_grid)):
            if time_grid[j] > target_time_grid[i]:
                last_index = j
                break
            last_value = values[j]
        result[i] = last_value
    return {'time_grid': target_time_grid, 'values': result}


current_time = datetime.now()
current_micro = (current_time.day * 24 * 3600 + current_time.hour * 3600 +
                 current_time.minute * 60 +
                 current_time.second) * 100000 + current_time.microsecond

# Initialize the seed of the pseudo random number generator
HP_wrapper.set_seed(current_micro)

# How many seconds will be simulated
n_seconds = 1200

# Parameters of the simulation
mu = 0.17
alpha = 0.011
beta = 0.04
dim = 2
mus = [mu, mu]
alphas = [[0.0, alpha], [alpha, 0.0]]
betas = [[0.0, beta], [beta, 0.0]]
mus = np.asanyarray(mus, dtype=np.double)
alphas = np.asanyarray(alphas, dtype=np.double)
betas = np.asanyarray(betas, dtype=np.double)
'''

from datetime import datetime
from matplotlib import pyplot as plt
import numpy as np
import time
import resource

import HP_simulator.HP_wrapper as HP_wrapper
import add_traj_wrapper

current_time = datetime.now()
current_micro = (current_time.day * 24 * 3600 + current_time.hour * 3600 + current_time.minute * 60 + current_time.second) * 100000 + current_time.microsecond

# Initialize the seed of the pseudo random number generator
HP_wrapper.set_seed(current_micro)

# How many seconds will be simulated
n_seconds = 3600

# Parameters of the simulation
dim = 2
mus = [0.13, 0.13]
alphas = [[0.0, 0.023],
          [0.023, 0.0]]
betas = [[0.0, 0.20],
         [0.20, 0.0]]
mus = np.asanyarray(mus, dtype = np.double)
alphas = np.asanyarray(alphas, dtype = np.double)
betas = np.asanyarray(betas, dtype = np.double)