forked from pjpetersik/neural-network-car-following-model
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
40 lines (29 loc) · 618 Bytes
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 30 16:09:01 2018
@author: paul
"""
from model import model
import numpy as np
import matplotlib.pyplot as plt
import time
print "Run ANN model #################"
N = 22
L = 150.
dt = 1./3.
tmax = 250
xpert= np.zeros(N)
xpert = 1.*np.sin(2*np.pi/float(N)*np.arange(N))
#xpert = np.random.uniform(0.,1.,N)
# Model simulation
start = time.time()
m = model(N,L,tmax,dt,xpert)
m.initCars()
m.integrate()
end = time.time()
print "calculation time: "+str(end-start)
#%% plot various variables
plt.close("all")
from plot import plots
plots(m)