@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | Route4Me::setApiKey(Constants::API_KEY); |
12 | 12 | |
13 | 13 | $gcParameters = (array) Geocoding::fromArray([ |
14 | - 'zipcode' => '00601', |
|
14 | + 'zipcode' => '00601', |
|
15 | 15 | ]); |
16 | 16 | |
17 | 17 | $geoCoding = new Geocoding(); |
@@ -19,6 +19,6 @@ discard block |
||
19 | 19 | $response = $geoCoding->getZipCode($gcParameters); |
20 | 20 | |
21 | 21 | foreach ($response as $gCode) { |
22 | - Route4Me::simplePrint($gCode); |
|
23 | - echo '<br>'; |
|
22 | + Route4Me::simplePrint($gCode); |
|
23 | + echo '<br>'; |
|
24 | 24 | } |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | Route4Me::setApiKey(Constants::API_KEY); |
10 | 10 | |
11 | 11 | $geoCodingParameters = [ |
12 | - 'strExportFormat' => 'json', |
|
13 | - 'addresses' => 'Los20%Angeles20%International20%Airport,20%CA', |
|
12 | + 'strExportFormat' => 'json', |
|
13 | + 'addresses' => 'Los20%Angeles20%International20%Airport,20%CA', |
|
14 | 14 | ]; |
15 | 15 | |
16 | 16 | $fGeoCoding = new Geocoding(); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $fgResult = $fGeoCoding->forwardGeocoding($geoCodingParameters); |
19 | 19 | |
20 | 20 | if ('json' == $geoCodingParameters['strExportFormat']) { |
21 | - Route4Me::simplePrint($fgResult); |
|
21 | + Route4Me::simplePrint($fgResult); |
|
22 | 22 | } else { |
23 | - Route4Me::simplePrint($fgResult['destination']); |
|
23 | + Route4Me::simplePrint($fgResult['destination']); |
|
24 | 24 | } |
@@ -17,6 +17,6 @@ |
||
17 | 17 | $response = $geoCoding->getStreetData($gcParameters); |
18 | 18 | |
19 | 19 | foreach ($response as $gCode) { |
20 | - Route4Me::simplePrint($gCode); |
|
21 | - echo '<br>'; |
|
20 | + Route4Me::simplePrint($gCode); |
|
21 | + echo '<br>'; |
|
22 | 22 | } |
@@ -12,8 +12,8 @@ |
||
12 | 12 | |
13 | 13 | // Get reandom address book location |
14 | 14 | $AddressBookLocationParameters = [ |
15 | - 'limit' => 30, |
|
16 | - 'offset' => 0, |
|
15 | + 'limit' => 30, |
|
16 | + 'offset' => 0, |
|
17 | 17 | ]; |
18 | 18 | |
19 | 19 | $randomLocation = $abLocation->getRandomAddressBookLocation($AddressBookLocationParameters); |
@@ -21,19 +21,19 @@ discard block |
||
21 | 21 | $addresses = []; |
22 | 22 | |
23 | 23 | foreach ($json as $address) { |
24 | - $addresses[] = Address::fromArray($address); |
|
24 | + $addresses[] = Address::fromArray($address); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | $parameters = RouteParameters::fromArray([ |
28 | - 'algorithm_type' => AlgorithmType::TSP, |
|
29 | - 'distance_unit' => DistanceUnit::MILES, |
|
30 | - 'device_type' => DeviceType::WEB, |
|
31 | - 'optimize' => OptimizationType::DISTANCE, |
|
32 | - 'travel_mode' => TravelMode::DRIVING, |
|
33 | - 'route_max_duration' => 86400, |
|
34 | - 'vehicle_capacity' => 1, |
|
35 | - 'vehicle_max_distance_mi' => 10000, |
|
36 | - 'rt' => true, |
|
28 | + 'algorithm_type' => AlgorithmType::TSP, |
|
29 | + 'distance_unit' => DistanceUnit::MILES, |
|
30 | + 'device_type' => DeviceType::WEB, |
|
31 | + 'optimize' => OptimizationType::DISTANCE, |
|
32 | + 'travel_mode' => TravelMode::DRIVING, |
|
33 | + 'route_max_duration' => 86400, |
|
34 | + 'vehicle_capacity' => 1, |
|
35 | + 'vehicle_max_distance_mi' => 10000, |
|
36 | + 'rt' => true, |
|
37 | 37 | ]); |
38 | 38 | |
39 | 39 | $optimizationParams = new OptimizationProblemParams(); |
@@ -43,5 +43,5 @@ discard block |
||
43 | 43 | $problems = OptimizationProblem::optimize($optimizationParams); |
44 | 44 | |
45 | 45 | foreach ($problems as $problem) { |
46 | - Route4Me::simplePrint($problem, true ); |
|
46 | + Route4Me::simplePrint($problem, true ); |
|
47 | 47 | } |
@@ -23,20 +23,20 @@ discard block |
||
23 | 23 | $addresses = []; |
24 | 24 | |
25 | 25 | foreach ($json as $address) { |
26 | - $addresses[] = Address::fromArray($address); |
|
26 | + $addresses[] = Address::fromArray($address); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | $parameters = RouteParameters::fromArray([ |
30 | - 'algorithm_type' => AlgorithmType::TSP, |
|
31 | - 'distance_unit' => DistanceUnit::MILES, |
|
32 | - 'device_type' => DeviceType::WEB, |
|
33 | - 'optimize' => OptimizationType::DISTANCE, |
|
34 | - 'travel_mode' => TravelMode::DRIVING, |
|
35 | - 'route_max_duration' => 86400, |
|
36 | - 'vehicle_capacity' => 1, |
|
37 | - 'vehicle_max_distance_mi' => 10000, |
|
38 | - 'rt' => true, |
|
39 | - 'optimized_callback_url' => 'https://requestb.in/1o6cgge1', |
|
30 | + 'algorithm_type' => AlgorithmType::TSP, |
|
31 | + 'distance_unit' => DistanceUnit::MILES, |
|
32 | + 'device_type' => DeviceType::WEB, |
|
33 | + 'optimize' => OptimizationType::DISTANCE, |
|
34 | + 'travel_mode' => TravelMode::DRIVING, |
|
35 | + 'route_max_duration' => 86400, |
|
36 | + 'vehicle_capacity' => 1, |
|
37 | + 'vehicle_max_distance_mi' => 10000, |
|
38 | + 'rt' => true, |
|
39 | + 'optimized_callback_url' => 'https://requestb.in/1o6cgge1', |
|
40 | 40 | ]); |
41 | 41 | |
42 | 42 | $optimizationParams = new OptimizationProblemParams(); |
@@ -46,5 +46,5 @@ discard block |
||
46 | 46 | $problems = OptimizationProblem::optimize($optimizationParams); |
47 | 47 | |
48 | 48 | foreach ($problems as $problem) { |
49 | - Route4Me::simplePrint($problem, true); |
|
49 | + Route4Me::simplePrint($problem, true); |
|
50 | 50 | } |
@@ -12,10 +12,10 @@ discard block |
||
12 | 12 | Route4Me::setApiKey(Constants::API_KEY); |
13 | 13 | |
14 | 14 | $AddressBookLocationParameters = AddressBookLocation::fromArray([ |
15 | - 'first_name' => 'Test FirstName '.strval(rand(10000, 99999)), |
|
16 | - 'address_1' => 'Test Address1 '.strval(rand(10000, 99999)), |
|
17 | - 'cached_lat' => 38.024654, |
|
18 | - 'cached_lng' => -77.338814, |
|
15 | + 'first_name' => 'Test FirstName '.strval(rand(10000, 99999)), |
|
16 | + 'address_1' => 'Test Address1 '.strval(rand(10000, 99999)), |
|
17 | + 'cached_lat' => 38.024654, |
|
18 | + 'cached_lng' => -77.338814, |
|
19 | 19 | ]); |
20 | 20 | |
21 | 21 | $abContacts = new AddressBookLocation(); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $address_id = -1; |
26 | 26 | |
27 | 27 | if (isset($createdContact['address_id'])) { |
28 | - $address_id = $createdContact['address_id']; |
|
28 | + $address_id = $createdContact['address_id']; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | assert($address_id != -1, 'Creating of Address Book Location was failed. Try again!.. <br>'); |
@@ -20,18 +20,18 @@ |
||
20 | 20 | |
21 | 21 | $addresses = []; |
22 | 22 | foreach ($json as $address) { |
23 | - $addresses[] = Address::fromArray($address); |
|
23 | + $addresses[] = Address::fromArray($address); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | $parameters = RouteParameters::fromArray([ |
27 | - 'algorithm_type' => AlgorithmType::TSP, |
|
28 | - 'distance_unit' => DistanceUnit::MILES, |
|
29 | - 'device_type' => DeviceType::WEB, |
|
30 | - 'optimize' => OptimizationType::DISTANCE, |
|
31 | - 'travel_mode' => TravelMode::DRIVING, |
|
32 | - 'route_max_duration' => 86400, |
|
33 | - 'vehicle_capacity' => 1, |
|
34 | - 'vehicle_max_distance_mi' => 10000, |
|
27 | + 'algorithm_type' => AlgorithmType::TSP, |
|
28 | + 'distance_unit' => DistanceUnit::MILES, |
|
29 | + 'device_type' => DeviceType::WEB, |
|
30 | + 'optimize' => OptimizationType::DISTANCE, |
|
31 | + 'travel_mode' => TravelMode::DRIVING, |
|
32 | + 'route_max_duration' => 86400, |
|
33 | + 'vehicle_capacity' => 1, |
|
34 | + 'vehicle_max_distance_mi' => 10000, |
|
35 | 35 | ]); |
36 | 36 | |
37 | 37 | $optimizationParams = new OptimizationProblemParams(); |
@@ -21,24 +21,24 @@ discard block |
||
21 | 21 | |
22 | 22 | $addresses = []; |
23 | 23 | foreach ($json as $address) { |
24 | - $addresses[] = Address::fromArray($address); |
|
24 | + $addresses[] = Address::fromArray($address); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | $parameters = RouteParameters::fromArray([ |
28 | - 'algorithm_type' => Algorithmtype::CVRP_TW_SD, |
|
29 | - 'route_name' => 'Single Depot, Multiple Driver, No Time Window', |
|
30 | - 'route_date' => time() + 24 * 60 * 60, |
|
31 | - 'route_time' => 60 * 60 * 7, |
|
32 | - 'rt' => true, |
|
33 | - 'distance_unit' => DistanceUnit::MILES, |
|
34 | - 'device_type' => DeviceType::WEB, |
|
35 | - 'optimize' => OptimizationType::TIME, |
|
36 | - 'metric' => Metric::GEODESIC, |
|
37 | - 'route_max_duration' => 86400, |
|
38 | - 'travel_mode' => TravelMode::DRIVING, |
|
39 | - 'vehicle_capacity' => 20, |
|
40 | - 'vehicle_max_distance_mi' => 99999, |
|
41 | - 'parts' => 4, |
|
28 | + 'algorithm_type' => Algorithmtype::CVRP_TW_SD, |
|
29 | + 'route_name' => 'Single Depot, Multiple Driver, No Time Window', |
|
30 | + 'route_date' => time() + 24 * 60 * 60, |
|
31 | + 'route_time' => 60 * 60 * 7, |
|
32 | + 'rt' => true, |
|
33 | + 'distance_unit' => DistanceUnit::MILES, |
|
34 | + 'device_type' => DeviceType::WEB, |
|
35 | + 'optimize' => OptimizationType::TIME, |
|
36 | + 'metric' => Metric::GEODESIC, |
|
37 | + 'route_max_duration' => 86400, |
|
38 | + 'travel_mode' => TravelMode::DRIVING, |
|
39 | + 'vehicle_capacity' => 20, |
|
40 | + 'vehicle_max_distance_mi' => 99999, |
|
41 | + 'parts' => 4, |
|
42 | 42 | ]); |
43 | 43 | |
44 | 44 | $optimizationParams = new OptimizationProblemParams(); |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | $problem = OptimizationProblem::optimize($optimizationParams); |
49 | 49 | |
50 | 50 | foreach ((array) $problem as $key => $value) { |
51 | - if (is_string($value)) { |
|
52 | - echo $key.' --> '.$value.'<br>'; |
|
53 | - } else { |
|
54 | - echo "************ $key ************* <br>"; |
|
55 | - Route4Me::simplePrint((array) $value, true); |
|
56 | - echo '******************************* <br>'; |
|
57 | - } |
|
51 | + if (is_string($value)) { |
|
52 | + echo $key.' --> '.$value.'<br>'; |
|
53 | + } else { |
|
54 | + echo "************ $key ************* <br>"; |
|
55 | + Route4Me::simplePrint((array) $value, true); |
|
56 | + echo '******************************* <br>'; |
|
57 | + } |
|
58 | 58 | } |