-
Notifications
You must be signed in to change notification settings - Fork 3
/
call.jl
49 lines (41 loc) · 1.29 KB
/
call.jl
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
41
42
43
44
45
46
47
48
49
using JSON
using Serialization
using DelimitedFiles
using Distances
param = JSON.parsefile("hyper-parameters.json")
regionps = param["region"]
cityname = regionps["cityname"]
cellsize = regionps["cellsize"]
include("utils.jl")
region = SpatialRegion(cityname,
regionps["minlon"], regionps["minlat"],
regionps["maxlon"], regionps["maxlat"],
cellsize, cellsize,
regionps["minfreq"], # minfreq
40_000, # maxvocab_size
10, # k
4)
println("Building spatial region with:
cityname=$(region.name),
minlon=$(region.minlon),
minlat=$(region.minlat),
maxlon=$(region.maxlon),
maxlat=$(region.maxlat),
xstep=$(region.xstep),
ystep=$(region.ystep),
minfreq=$(region.minfreq)")
paramfile = "porto-param-cell100"
if isfile(paramfile)
println("Reading parameter file from $paramfile")
region = deserialize(paramfile)
println("Loaded $paramfile into region")
else
println("Cannot find $paramfile")
end
include("SpatialRegionTools.jl")
function get_token(lon::Float64, lat::Float64)
gps2vocab(region, lon, lat)
end
function get_seq(trip::Matrix{Float64})
trip2seq(region, trip)
end