@@ -16,14 +16,14 @@ |
||
| 16 | 16 | |
| 17 | 17 | $territoryParams['type'] = TerritoryTypes::RECT; |
| 18 | 18 | $territoryParams['data'] = array( |
| 19 | - "43.51668853502909,-109.3798828125", |
|
| 20 | - "46.98025235521883,-101.865234375" |
|
| 19 | + "43.51668853502909,-109.3798828125", |
|
| 20 | + "46.98025235521883,-101.865234375" |
|
| 21 | 21 | ); |
| 22 | 22 | |
| 23 | 23 | $TerritoryParameters = Territory::fromArray(array( |
| 24 | - "territory_name" => "Test Rectangular Territory ".strval(rand(10000, 99999)), |
|
| 25 | - "territory_color" => "ff7700", |
|
| 26 | - "territory" => $territoryParams |
|
| 24 | + "territory_name" => "Test Rectangular Territory ".strval(rand(10000, 99999)), |
|
| 25 | + "territory_color" => "ff7700", |
|
| 26 | + "territory" => $territoryParams |
|
| 27 | 27 | )); |
| 28 | 28 | |
| 29 | 29 | $territory = new Territory(); |
@@ -18,14 +18,14 @@ discard block |
||
| 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 | $TerritoryParameters = Territory::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 | $result = (array)$territory->addTerritory($TerritoryParameters); |
@@ -38,18 +38,18 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | // Update territory |
| 40 | 40 | $territoryParameters = array ( |
| 41 | - "type" => TerritoryTypes::RECT, |
|
| 42 | - "data" => array( |
|
| 43 | - "29.6600127358956,-95.6593322753906", |
|
| 44 | - "29.8966150753098,-95.3146362304688" |
|
| 45 | - ) |
|
| 41 | + "type" => TerritoryTypes::RECT, |
|
| 42 | + "data" => array( |
|
| 43 | + "29.6600127358956,-95.6593322753906", |
|
| 44 | + "29.8966150753098,-95.3146362304688" |
|
| 45 | + ) |
|
| 46 | 46 | ); |
| 47 | 47 | |
| 48 | 48 | $TerritoryParameters = Territory::fromArray(array( |
| 49 | - "territory_id" => $territory_id, |
|
| 50 | - "territory_name" => "Test Territory Updated as rectangle", |
|
| 51 | - "territory_color" => "ff5500", |
|
| 52 | - "territory" => $territoryParameters |
|
| 49 | + "territory_id" => $territory_id, |
|
| 50 | + "territory_name" => "Test Territory Updated as rectangle", |
|
| 51 | + "territory_color" => "ff5500", |
|
| 52 | + "territory" => $territoryParameters |
|
| 53 | 53 | )); |
| 54 | 54 | |
| 55 | 55 | $result1 = $territory->updateTerritory($TerritoryParameters); |
@@ -16,21 +16,21 @@ |
||
| 16 | 16 | |
| 17 | 17 | $territoryParams['type'] = TerritoryTypes::POLY; |
| 18 | 18 | $territoryParams['data'] = array( |
| 19 | - "37.769752822786455,-77.67833251953125", |
|
| 20 | - "37.75886716305343,-77.68974800109863", |
|
| 21 | - "37.74763966054455,-77.6917221069336", |
|
| 22 | - "37.74655084306813,-77.68863220214844", |
|
| 23 | - "37.7502255383101,-77.68125076293945", |
|
| 24 | - "37.74797991274437,-77.67498512268066", |
|
| 25 | - "37.73327960206065,-77.6411678314209", |
|
| 26 | - "37.74430510679532,-77.63172645568848", |
|
| 27 | - "37.76641925847049,-77.66846199035645" |
|
| 19 | + "37.769752822786455,-77.67833251953125", |
|
| 20 | + "37.75886716305343,-77.68974800109863", |
|
| 21 | + "37.74763966054455,-77.6917221069336", |
|
| 22 | + "37.74655084306813,-77.68863220214844", |
|
| 23 | + "37.7502255383101,-77.68125076293945", |
|
| 24 | + "37.74797991274437,-77.67498512268066", |
|
| 25 | + "37.73327960206065,-77.6411678314209", |
|
| 26 | + "37.74430510679532,-77.63172645568848", |
|
| 27 | + "37.76641925847049,-77.66846199035645" |
|
| 28 | 28 | ); |
| 29 | 29 | |
| 30 | 30 | $TerritoryParameters = Territory::fromArray(array( |
| 31 | - "territory_name" => "Test Polygonian Territory ".strval(rand(10000, 99999)), |
|
| 32 | - "territory_color" => "ff7700", |
|
| 33 | - "territory" => $territoryParams |
|
| 31 | + "territory_name" => "Test Polygonian Territory ".strval(rand(10000, 99999)), |
|
| 32 | + "territory_color" => "ff7700", |
|
| 33 | + "territory" => $territoryParams |
|
| 34 | 34 | )); |
| 35 | 35 | |
| 36 | 36 | $territory = new Territory(); |
@@ -18,14 +18,14 @@ discard block |
||
| 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 | $TerritoryParameters = Territory::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 | $territory = new Territory(); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | echo "---------------------------------------------------------------<br><br>"; |
| 42 | 42 | |
| 43 | 43 | $params = array( |
| 44 | - "territory_id" => $territory_id |
|
| 44 | + "territory_id" => $territory_id |
|
| 45 | 45 | ); |
| 46 | 46 | |
| 47 | 47 | $result1 = $territory->getTerritory($params); |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | // The example refers to the process of searching for the specified text throughout all routes, belonging to the user's account. |
| 14 | 14 | |
| 15 | 15 | $RouteParameters = array( |
| 16 | - "query" => 'Automated' |
|
| 16 | + "query" => 'Automated' |
|
| 17 | 17 | ); |
| 18 | 18 | |
| 19 | 19 | $route = new Route(); |
@@ -22,15 +22,15 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | foreach ($routeResults as $routeResult) |
| 24 | 24 | { |
| 25 | - $results = (array)$routeResult; |
|
| 25 | + $results = (array)$routeResult; |
|
| 26 | 26 | |
| 27 | - if (isset($results['route_id'])) { |
|
| 28 | - echo "Route ID - > " . $results['route_id'] . "<br>"; |
|
| 29 | - } |
|
| 27 | + if (isset($results['route_id'])) { |
|
| 28 | + echo "Route ID - > " . $results['route_id'] . "<br>"; |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - if (isset($results['parameters']->route_name)) { |
|
| 32 | - echo "Route name - > ".$results['parameters']->route_name."<br>"; |
|
| 33 | - } |
|
| 31 | + if (isset($results['parameters']->route_name)) { |
|
| 32 | + echo "Route name - > ".$results['parameters']->route_name."<br>"; |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - echo "<br>"; |
|
| 35 | + echo "<br>"; |
|
| 36 | 36 | } |
@@ -25,13 +25,13 @@ discard block |
||
| 25 | 25 | $count = 0; |
| 26 | 26 | |
| 27 | 27 | while ($route_id1==$route_id2) { |
| 28 | - $route_id2 = $route->getRandomRouteId(0, 20); |
|
| 28 | + $route_id2 = $route->getRandomRouteId(0, 20); |
|
| 29 | 29 | |
| 30 | - $count++; |
|
| 30 | + $count++; |
|
| 31 | 31 | |
| 32 | - if ($count>5) { |
|
| 33 | - break; |
|
| 34 | - } |
|
| 32 | + if ($count>5) { |
|
| 33 | + break; |
|
| 34 | + } |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | echo "Route ID 1 -> $route_id1 <br> Route ID 2 -> $route_id2 <br>"; |
@@ -43,21 +43,21 @@ discard block |
||
| 43 | 43 | $depot = null; |
| 44 | 44 | |
| 45 | 45 | foreach ($addresses as $address) { |
| 46 | - if (isset($address->is_depot)) { |
|
| 47 | - if ($address->is_depot==true) { |
|
| 48 | - $depot = $address; |
|
| 49 | - break; |
|
| 50 | - } |
|
| 51 | - } |
|
| 46 | + if (isset($address->is_depot)) { |
|
| 47 | + if ($address->is_depot==true) { |
|
| 48 | + $depot = $address; |
|
| 49 | + break; |
|
| 50 | + } |
|
| 51 | + } |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | // Merge the selected routes |
| 55 | 55 | $params = array( |
| 56 | - "route_ids" => $route_id1.",".$route_id2, |
|
| 57 | - "depot_address" => $depot->address, |
|
| 58 | - "remove_origin" => false, |
|
| 59 | - "depot_lat" => $depot->lat, |
|
| 60 | - "depot_lat" => $depot->lng |
|
| 56 | + "route_ids" => $route_id1.",".$route_id2, |
|
| 57 | + "depot_address" => $depot->address, |
|
| 58 | + "remove_origin" => false, |
|
| 59 | + "depot_lat" => $depot->lat, |
|
| 60 | + "depot_lat" => $depot->lng |
|
| 61 | 61 | ); |
| 62 | 62 | |
| 63 | 63 | $result = $route->mergeRoutes($params); |
@@ -23,26 +23,26 @@ |
||
| 23 | 23 | |
| 24 | 24 | // Get a route with the path points |
| 25 | 25 | $params = array( |
| 26 | - "route_path_output" => "Points", |
|
| 27 | - "compress_path_points" => TRUE, |
|
| 28 | - "route_id" => $route_id |
|
| 26 | + "route_path_output" => "Points", |
|
| 27 | + "compress_path_points" => TRUE, |
|
| 28 | + "route_id" => $route_id |
|
| 29 | 29 | ); |
| 30 | 30 | |
| 31 | 31 | $routeResults = (array)$route->getRoutePoints($params); |
| 32 | 32 | |
| 33 | 33 | if (isset($routeResults['addresses'])) { |
| 34 | - foreach ($routeResults['addresses'] as $key => $address) { |
|
| 35 | - $araddress = (array)$address; |
|
| 34 | + foreach ($routeResults['addresses'] as $key => $address) { |
|
| 35 | + $araddress = (array)$address; |
|
| 36 | 36 | |
| 37 | - if (isset($araddress['route_destination_id'])) { |
|
| 38 | - echo "route_destination_id=".$araddress['route_destination_id']."<br>"; |
|
| 39 | - } |
|
| 37 | + if (isset($araddress['route_destination_id'])) { |
|
| 38 | + echo "route_destination_id=".$araddress['route_destination_id']."<br>"; |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - if (isset($araddress['path_to_next'])) { |
|
| 42 | - echo "path_to_next:<br>"; |
|
| 43 | - Route4Me::simplePrint((array)$araddress['path_to_next']); |
|
| 44 | - } |
|
| 41 | + if (isset($araddress['path_to_next'])) { |
|
| 42 | + echo "path_to_next:<br>"; |
|
| 43 | + Route4Me::simplePrint((array)$araddress['path_to_next']); |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - echo "<br>"; |
|
| 47 | - } |
|
| 46 | + echo "<br>"; |
|
| 47 | + } |
|
| 48 | 48 | } |
@@ -24,10 +24,10 @@ |
||
| 24 | 24 | |
| 25 | 25 | // Remove an optimization |
| 26 | 26 | $params = array( |
| 27 | - "optimization_problem_ids" => array( |
|
| 28 | - "0" => $optimizationProblemId |
|
| 29 | - ), |
|
| 30 | - "redirect" => 0 |
|
| 27 | + "optimization_problem_ids" => array( |
|
| 28 | + "0" => $optimizationProblemId |
|
| 29 | + ), |
|
| 30 | + "redirect" => 0 |
|
| 31 | 31 | ); |
| 32 | 32 | |
| 33 | 33 | $result = $optimization->removeOptimization($params); |
@@ -18,38 +18,38 @@ |
||
| 18 | 18 | $vehicle = new Vehicle(); |
| 19 | 19 | |
| 20 | 20 | $vehicleParameters = Vehicle::fromArray(array( |
| 21 | - 'vehicle_alias' => 'Peterbilt 579', |
|
| 22 | - 'vehicle_vin' => '1NP5DB9X93N507873', |
|
| 23 | - 'vehicle_license_plate' => 'PPV7516', |
|
| 24 | - 'license_start_date' => '2017-06-05', |
|
| 25 | - 'license_end_date' => '2021-08-14', |
|
| 26 | - 'vehicle_model' => '579', |
|
| 27 | - 'vehicle_model_year' => 2015, |
|
| 28 | - 'vehicle_year_acquired' => 2018, |
|
| 29 | - 'vehicle_reg_country_id' => '223', |
|
| 30 | - 'vehicle_make' => 'Peterbilt', |
|
| 31 | - 'vehicle_type_id' => 'tractor_trailer', |
|
| 32 | - 'has_trailer' => true, |
|
| 33 | - 'vehicle_axle_count' => 5, |
|
| 34 | - 'mpg_city' => 6, |
|
| 35 | - 'mpg_highway' => 12, |
|
| 36 | - 'fuel_type' => 'diesel', |
|
| 37 | - 'height_inches' => 114, |
|
| 38 | - 'height_metric' => 290, |
|
| 39 | - 'weight_lb' => 50350, |
|
| 40 | - 'maxWeightPerAxleGroupInPounds' => 40000, |
|
| 41 | - 'max_weight_per_axle_group_metric' => 18000, |
|
| 42 | - 'widthInInches' => 102, |
|
| 43 | - 'width_metric' => 258, |
|
| 44 | - 'lengthInInches' => 640, |
|
| 45 | - 'length_metric' => 1625, |
|
| 46 | - 'Use53FootTrailerRouting' => 'YES', |
|
| 47 | - 'UseTruckRestrictions' => 'YES', |
|
| 48 | - 'DividedHighwayAvoidPreference' => 'STRONG_AVOID', |
|
| 49 | - 'FreewayAvoidPreference' => 'STRONG_AVOID', |
|
| 50 | - 'truck_config' => '53_SEMI_TRAILER', |
|
| 51 | - 'InternationalBordersOpen' => 'YES', |
|
| 52 | - 'purchased_new' => true |
|
| 21 | + 'vehicle_alias' => 'Peterbilt 579', |
|
| 22 | + 'vehicle_vin' => '1NP5DB9X93N507873', |
|
| 23 | + 'vehicle_license_plate' => 'PPV7516', |
|
| 24 | + 'license_start_date' => '2017-06-05', |
|
| 25 | + 'license_end_date' => '2021-08-14', |
|
| 26 | + 'vehicle_model' => '579', |
|
| 27 | + 'vehicle_model_year' => 2015, |
|
| 28 | + 'vehicle_year_acquired' => 2018, |
|
| 29 | + 'vehicle_reg_country_id' => '223', |
|
| 30 | + 'vehicle_make' => 'Peterbilt', |
|
| 31 | + 'vehicle_type_id' => 'tractor_trailer', |
|
| 32 | + 'has_trailer' => true, |
|
| 33 | + 'vehicle_axle_count' => 5, |
|
| 34 | + 'mpg_city' => 6, |
|
| 35 | + 'mpg_highway' => 12, |
|
| 36 | + 'fuel_type' => 'diesel', |
|
| 37 | + 'height_inches' => 114, |
|
| 38 | + 'height_metric' => 290, |
|
| 39 | + 'weight_lb' => 50350, |
|
| 40 | + 'maxWeightPerAxleGroupInPounds' => 40000, |
|
| 41 | + 'max_weight_per_axle_group_metric' => 18000, |
|
| 42 | + 'widthInInches' => 102, |
|
| 43 | + 'width_metric' => 258, |
|
| 44 | + 'lengthInInches' => 640, |
|
| 45 | + 'length_metric' => 1625, |
|
| 46 | + 'Use53FootTrailerRouting' => 'YES', |
|
| 47 | + 'UseTruckRestrictions' => 'YES', |
|
| 48 | + 'DividedHighwayAvoidPreference' => 'STRONG_AVOID', |
|
| 49 | + 'FreewayAvoidPreference' => 'STRONG_AVOID', |
|
| 50 | + 'truck_config' => '53_SEMI_TRAILER', |
|
| 51 | + 'InternationalBordersOpen' => 'YES', |
|
| 52 | + 'purchased_new' => true |
|
| 53 | 53 | )); |
| 54 | 54 | |
| 55 | 55 | $result = $vehicle->createVehicle($vehicleParameters); |