Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions predict.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
import JSON


function neuts_and_li(distance, routes, interaction_degree)
return distance * routes^interaction_degree
end

function read_response(
path = "./data/sample_response_direction.json"
)
path = "./data/sample_response_direction.json")

response = String(read(path))
response_json = JSON.parse(response)
return response_json
end

function predict(clustor_lat, clustor_lng, lat, lng, time_frame)
virus_factor = rand(1:100) / 100
function predict(clustor_lat, clustor_lng, lat, lng, time_frame, risk_function_type = "random")
if risk_function_type == "random"
virus_factor = rand(1:100) / 100
end
if risk_function_type == "neuts_and_li"
virus_factor = neuts_and_li(100, 2, 0.2)
end
response = read_response()
route = first(response["routes"])
leg = first(route["legs"])
Expand Down