@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | Route4Me::setApiKey('11111111111111111111111111111111'); |
12 | 12 | |
13 | 13 | $geocodingParameters = array( |
14 | - 'format' => 'xml', |
|
15 | - 'addresses' => '42.35863,-71.05670' |
|
14 | + 'format' => 'xml', |
|
15 | + 'addresses' => '42.35863,-71.05670' |
|
16 | 16 | ); |
17 | 17 | |
18 | 18 | $fGeoCoding = new Geocoding(); |
@@ -20,13 +20,13 @@ discard block |
||
20 | 20 | $fgResult = $fGeoCoding->reverseGeocoding($geocodingParameters); |
21 | 21 | |
22 | 22 | if ($geocodingParameters['format']=='json') { |
23 | - foreach ($fgResult as $dest) { |
|
24 | - Route4Me::simplePrint($dest); |
|
25 | - echo "<br>"; |
|
26 | - } |
|
23 | + foreach ($fgResult as $dest) { |
|
24 | + Route4Me::simplePrint($dest); |
|
25 | + echo "<br>"; |
|
26 | + } |
|
27 | 27 | } else { |
28 | - foreach ($fgResult['destination'] as $dest) { |
|
29 | - Route4Me::simplePrint($dest); |
|
30 | - echo "<br>"; |
|
31 | - } |
|
28 | + foreach ($fgResult['destination'] as $dest) { |
|
29 | + Route4Me::simplePrint($dest); |
|
30 | + echo "<br>"; |
|
31 | + } |
|
32 | 32 | } |
@@ -18,14 +18,14 @@ |
||
18 | 18 | |
19 | 19 | $territoryParams['type'] = TerritoryTypes::CIRCLE; |
20 | 20 | $territoryParams['data'] = array( |
21 | - "37.569752822786455,-77.47833251953125", |
|
22 | - "5000" |
|
21 | + "37.569752822786455,-77.47833251953125", |
|
22 | + "5000" |
|
23 | 23 | ); |
24 | 24 | |
25 | 25 | $AvoisanceZoneParameters = AvoidanceZone::fromArray(array( |
26 | - "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
27 | - "territory_color" => "ff7700", |
|
28 | - "territory" => $territoryParams |
|
26 | + "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
27 | + "territory_color" => "ff7700", |
|
28 | + "territory" => $territoryParams |
|
29 | 29 | )); |
30 | 30 | |
31 | 31 | $avoidancezone = new AvoidanceZone(); |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | $route = new Route(); |
17 | 17 | |
18 | 18 | $grParams = array( |
19 | - 'offset' => 0, |
|
20 | - 'limit' => 10 |
|
19 | + 'offset' => 0, |
|
20 | + 'limit' => 10 |
|
21 | 21 | ); |
22 | 22 | |
23 | 23 | $routes = $route->getRoutes($grParams); |
@@ -32,8 +32,8 @@ discard block |
||
32 | 32 | echo "<br> From the route -> ".$route_id0."<br>"; |
33 | 33 | |
34 | 34 | if (is_null($route_id0)) { |
35 | - echo "Can't retrieve random route_id!.. Try again."; |
|
36 | - return; |
|
35 | + echo "Can't retrieve random route_id!.. Try again."; |
|
36 | + return; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | // Get random source destination from selected source route above |
@@ -48,14 +48,14 @@ discard block |
||
48 | 48 | $to_route_id = $route_id0; |
49 | 49 | |
50 | 50 | while ($to_route_id==$route_id0) { |
51 | - $to_route_id = $routes[rand(0, sizeof($routes) - 1)]->route_id; |
|
51 | + $to_route_id = $routes[rand(0, sizeof($routes) - 1)]->route_id; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | echo "<br> to the route -> ".$to_route_id."<br>"; |
55 | 55 | |
56 | 56 | if (is_null($to_route_id)) { |
57 | - echo "Can't retrieve random route_id!.. Try again."; |
|
58 | - return; |
|
57 | + echo "Can't retrieve random route_id!.. Try again."; |
|
58 | + return; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | // Get random destination destination from selected source route above |
@@ -64,17 +64,17 @@ discard block |
||
64 | 64 | $after_destination_id = $addressRand2['route_destination_id']; |
65 | 65 | |
66 | 66 | if (is_null($after_destination_id)) { |
67 | - echo "can't retrieve random address!.. Try again."; |
|
68 | - return; |
|
67 | + echo "can't retrieve random address!.. Try again."; |
|
68 | + return; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | echo "after_destination_id = $after_destination_id <br>"; |
72 | 72 | |
73 | 73 | // Move the destination to the route |
74 | 74 | $routeparams = array( |
75 | - 'to_route_id' => $to_route_id, |
|
76 | - 'route_destination_id' => strval($route_destination_id), |
|
77 | - 'after_destination_id' => strval($after_destination_id) |
|
75 | + 'to_route_id' => $to_route_id, |
|
76 | + 'route_destination_id' => strval($route_destination_id), |
|
77 | + 'after_destination_id' => strval($after_destination_id) |
|
78 | 78 | ); |
79 | 79 | |
80 | 80 | $address = new Address(); |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | assert(!is_null($addressRand), "Can't retrieve random address"); |
28 | 28 | |
29 | 29 | if (isset($addressRand['is_depot'])) { |
30 | - if ($addressRand['is_depot']) { |
|
31 | - echo "This address is depot!.. Try again."; |
|
32 | - return; |
|
33 | - } |
|
30 | + if ($addressRand['is_depot']) { |
|
31 | + echo "This address is depot!.. Try again."; |
|
32 | + return; |
|
33 | + } |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | $route_destination_id = $addressRand['route_destination_id']; |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | |
40 | 40 | // Remove the destination from the optimization |
41 | 41 | $params = array( |
42 | - "optimization_problem_id" => $optimization_problem_id, |
|
43 | - "route_destination_id" => $route_destination_id |
|
42 | + "optimization_problem_id" => $optimization_problem_id, |
|
43 | + "route_destination_id" => $route_destination_id |
|
44 | 44 | ); |
45 | 45 | |
46 | 46 | $result = $optimization->removeAddress($params); |