Created
October 23, 2014 19:55
-
-
Save nathanl/b28abccd7fb243b9cafd to your computer and use it in GitHub Desktop.
Test pathfinding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This can be run from the voltron directory while the NetSkycanner has a couple of `rake pathfinder` processes running | |
require 'bundler/setup' | |
Bundler.require :default, :pathfinder | |
require 'json' | |
require 'thump' | |
require 'mr_sulu_messages' | |
test = "searching" | |
t = Thump::Tunnel.new | |
case test | |
when "searching" | |
puts "going to send a search" | |
t.listen('mr_sulu.search.events', 'bh.paths.recorder') do |_, __, payload| | |
puts "search came back with payload:" | |
puts JSON.parse(payload).inspect | |
end | |
search = MrSuluMessages::Search.new( from: [28.9453, -13.605], | |
from_name: "Arrecife Flughafen (ACE)", | |
from_type: :station, | |
to: [5.6, -0.166667], | |
to_name: "Accra (ACC)", | |
to_type: :station ) | |
t.send("mr_sulu.vehicles.plane", search.to_hash) | |
puts "sent a search" | |
when "reloading" | |
puts "going to say to reload" | |
t.send("mr_sulu.bots.reload.NetSkyscanner", 1) | |
puts "said to reload" | |
end | |
sleep(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment