@@ -17,19 +17,19 @@ |
||
| 17 | 17 | |
| 18 | 18 | // Itereate through all the existing activity types |
| 19 | 19 | foreach ($activityTypes->getConstants() as $prop => $value) { |
| 20 | - $activityParameters = ActivityParameters::fromArray(array( |
|
| 21 | - "activity_type" => $value, |
|
| 22 | - "limit" => 2, |
|
| 23 | - "offset" => 0 |
|
| 24 | - )); |
|
| 20 | + $activityParameters = ActivityParameters::fromArray(array( |
|
| 21 | + "activity_type" => $value, |
|
| 22 | + "limit" => 2, |
|
| 23 | + "offset" => 0 |
|
| 24 | + )); |
|
| 25 | 25 | |
| 26 | - $activities = new ActivityParameters(); |
|
| 27 | - $results = $activities->searcActivities($activityParameters); |
|
| 26 | + $activities = new ActivityParameters(); |
|
| 27 | + $results = $activities->searcActivities($activityParameters); |
|
| 28 | 28 | |
| 29 | - foreach ($results as $key => $activity) { |
|
| 30 | - Route4Me::simplePrint($activity); |
|
| 31 | - echo "<br>"; |
|
| 32 | - } |
|
| 29 | + foreach ($results as $key => $activity) { |
|
| 30 | + Route4Me::simplePrint($activity); |
|
| 31 | + echo "<br>"; |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - echo "------------------- <br><br>"; |
|
| 34 | + echo "------------------- <br><br>"; |
|
| 35 | 35 | } |
@@ -21,20 +21,20 @@ |
||
| 21 | 21 | |
| 22 | 22 | // Itereate through all the existing activity types |
| 23 | 23 | foreach ($activityTypes->getConstants() as $prop => $value) { |
| 24 | - $activityParameters = ActivityParameters::fromArray(array( |
|
| 25 | - "activity_type" => $value, |
|
| 26 | - "limit" => 2, |
|
| 27 | - "offset" => 0, |
|
| 28 | - "route_id" => $route_id |
|
| 29 | - )); |
|
| 24 | + $activityParameters = ActivityParameters::fromArray(array( |
|
| 25 | + "activity_type" => $value, |
|
| 26 | + "limit" => 2, |
|
| 27 | + "offset" => 0, |
|
| 28 | + "route_id" => $route_id |
|
| 29 | + )); |
|
| 30 | 30 | |
| 31 | - $activities = new ActivityParameters(); |
|
| 32 | - $results = $activities->searcActivities($activityParameters); |
|
| 31 | + $activities = new ActivityParameters(); |
|
| 32 | + $results = $activities->searcActivities($activityParameters); |
|
| 33 | 33 | |
| 34 | - foreach ($results as $key => $activity) { |
|
| 35 | - Route4Me::simplePrint($activity); |
|
| 36 | - echo "<br>"; |
|
| 37 | - } |
|
| 34 | + foreach ($results as $key => $activity) { |
|
| 35 | + Route4Me::simplePrint($activity); |
|
| 36 | + echo "<br>"; |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - echo "------------------- <br><br>"; |
|
| 39 | + echo "------------------- <br><br>"; |
|
| 40 | 40 | } |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root=realpath(dirname(__FILE__).'/../../'); |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | 5 | require $root.'/vendor/autoload.php'; |
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
@@ -17,9 +17,9 @@ |
||
| 17 | 17 | $route_id = $route->getRandomRouteId(0, 10); |
| 18 | 18 | |
| 19 | 19 | $postParameters = ActivityParameters::fromArray(array( |
| 20 | - "activity_type" => "user_message", |
|
| 21 | - "activity_message" => "Hello - php!", |
|
| 22 | - "route_id" => $route_id |
|
| 20 | + "activity_type" => "user_message", |
|
| 21 | + "activity_message" => "Hello - php!", |
|
| 22 | + "route_id" => $route_id |
|
| 23 | 23 | )); |
| 24 | 24 | |
| 25 | 25 | $activities = new ActivityParameters(); |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root=realpath(dirname(__FILE__).'/../../'); |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | 5 | require $root.'/vendor/autoload.php'; |
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
@@ -26,10 +26,10 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $results = $activities->sendUserMessage($postParameters); |
| 28 | 28 | |
| 29 | -$msg = isset($results["status"]) != null |
|
| 29 | +$msg = isset($results["status"])!=null |
|
| 30 | 30 | ? ($results["status"]==1 ? "The user message was sent to the route " : "he user message could not sent to the route ") |
| 31 | 31 | : "The user message could not sent to the route "; |
| 32 | 32 | |
| 33 | -$msg.=" with route_id=".$route_id; |
|
| 33 | +$msg .= " with route_id=".$route_id; |
|
| 34 | 34 | |
| 35 | 35 | echo "<br> $msg <br>"; |
@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | assert(!is_null($routeId), "can't retrieve random route_id"); |
| 21 | 21 | |
| 22 | 22 | $activityParameters = ActivityParameters::fromArray(array( |
| 23 | - "route_id" => $routeId, |
|
| 24 | - "team" => "true" |
|
| 23 | + "route_id" => $routeId, |
|
| 24 | + "team" => "true" |
|
| 25 | 25 | )); |
| 26 | 26 | |
| 27 | 27 | $activities = new ActivityParameters(); |
@@ -30,5 +30,5 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | foreach ($results as $result) { |
| 32 | 32 | Route4Me::simplePrint($result); |
| 33 | - echo "<br>"; |
|
| 33 | + echo "<br>"; |
|
| 34 | 34 | } |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
| 5 | -require $root . '/vendor/autoload.php'; |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | +require $root.'/vendor/autoload.php'; |
|
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
| 8 | 8 | use Route4Me\Route; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $activities = new ActivityParameters(); |
| 28 | 28 | $actresults = $activities->get($activityParameters); |
| 29 | -$results = $activities->getValue($actresults,"results"); |
|
| 29 | +$results = $activities->getValue($actresults, "results"); |
|
| 30 | 30 | |
| 31 | 31 | foreach ($results as $result) { |
| 32 | 32 | Route4Me::simplePrint($result); |
@@ -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); |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
| 5 | -require $root . '/vendor/autoload.php'; |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | +require $root.'/vendor/autoload.php'; |
|
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
| 8 | 8 | use Route4Me\Address; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | assert(!is_null($route_destination_id), "Can't retrieve random address"); |
| 39 | 39 | |
| 40 | 40 | // Remove the destination from the optimization |
| 41 | -$params = array ( |
|
| 41 | +$params = array( |
|
| 42 | 42 | "optimization_problem_id" => $optimization_problem_id, |
| 43 | 43 | "route_destination_id" => $route_destination_id |
| 44 | 44 | ); |
@@ -30,19 +30,19 @@ |
||
| 30 | 30 | $addresses = array(); |
| 31 | 31 | |
| 32 | 32 | $address1 = (array)Address::fromArray(array( |
| 33 | - 'address' => '717 5th Ave New York, NY 10021', |
|
| 34 | - 'alias' => 'Giorgio Armani', |
|
| 35 | - 'lat' => 40.7669692, |
|
| 36 | - 'lng' => 73.9693864, |
|
| 37 | - 'time' => 0 |
|
| 33 | + 'address' => '717 5th Ave New York, NY 10021', |
|
| 34 | + 'alias' => 'Giorgio Armani', |
|
| 35 | + 'lat' => 40.7669692, |
|
| 36 | + 'lng' => 73.9693864, |
|
| 37 | + 'time' => 0 |
|
| 38 | 38 | )); |
| 39 | 39 | |
| 40 | 40 | $addresses[0] = $address1; |
| 41 | 41 | |
| 42 | 42 | $OptimizationParameters = (array)OptimizationProblem::fromArray(array( |
| 43 | - "optimization_problem_id" => $optimization_problem_id, |
|
| 44 | - "addresses" => $addresses, |
|
| 45 | - "reoptimize" => 1, |
|
| 43 | + "optimization_problem_id" => $optimization_problem_id, |
|
| 44 | + "addresses" => $addresses, |
|
| 45 | + "reoptimize" => 1, |
|
| 46 | 46 | )); |
| 47 | 47 | |
| 48 | 48 | $optimizationproblem = new OptimizationProblem(); |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
| 5 | -require $root . '/vendor/autoload.php'; |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | +require $root.'/vendor/autoload.php'; |
|
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
| 8 | 8 | use Route4Me\Route; |
@@ -25,20 +25,20 @@ |
||
| 25 | 25 | $addresses = array(); |
| 26 | 26 | |
| 27 | 27 | $params = array( |
| 28 | - "route_id" => $routeId, |
|
| 29 | - "addresses" => array( |
|
| 30 | - "0" => array( |
|
| 31 | - "address" => "Cabo Rojo, Cabo Rojo 00623, Puerto Rico", |
|
| 32 | - "alias" => "", |
|
| 33 | - "lat" => 18.086627, |
|
| 34 | - "lng" => -67.145735, |
|
| 35 | - "curbside_lat" => 18.086627, |
|
| 36 | - "curbside_lng" => -67.145735, |
|
| 37 | - "is_departed" => false, |
|
| 38 | - "is_visited" => false |
|
| 39 | - ) |
|
| 40 | - ), |
|
| 41 | - "optimal_position" => true |
|
| 28 | + "route_id" => $routeId, |
|
| 29 | + "addresses" => array( |
|
| 30 | + "0" => array( |
|
| 31 | + "address" => "Cabo Rojo, Cabo Rojo 00623, Puerto Rico", |
|
| 32 | + "alias" => "", |
|
| 33 | + "lat" => 18.086627, |
|
| 34 | + "lng" => -67.145735, |
|
| 35 | + "curbside_lat" => 18.086627, |
|
| 36 | + "curbside_lng" => -67.145735, |
|
| 37 | + "is_departed" => false, |
|
| 38 | + "is_visited" => false |
|
| 39 | + ) |
|
| 40 | + ), |
|
| 41 | + "optimal_position" => true |
|
| 42 | 42 | ); |
| 43 | 43 | |
| 44 | 44 | $route1 = new Route(); |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
| 5 | -require $root . '/vendor/autoload.php'; |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | +require $root.'/vendor/autoload.php'; |
|
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
| 8 | 8 | use Route4Me\Route; |
@@ -52,5 +52,5 @@ discard block |
||
| 52 | 52 | assert(isset($result->addresses), "Can't insert a destination into the route"); |
| 53 | 53 | |
| 54 | 54 | foreach ($result->addresses as $address) { |
| 55 | - echo "Address -> " . $address->address , ", Sequence number -> " . $address->sequence_no . "<br>"; |
|
| 55 | + echo "Address -> ".$address->address, ", Sequence number -> ".$address->sequence_no."<br>"; |
|
| 56 | 56 | } |
@@ -25,10 +25,10 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | if (isset($addressRand['is_depot'])) |
| 27 | 27 | { |
| 28 | - if ($addressRand['is_depot']) { |
|
| 29 | - echo "Random choosed address is depot, it can't be marked!.. Try again."; |
|
| 30 | - return; |
|
| 31 | - } |
|
| 28 | + if ($addressRand['is_depot']) { |
|
| 29 | + echo "Random choosed address is depot, it can't be marked!.. Try again."; |
|
| 30 | + return; |
|
| 31 | + } |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | $address_id = $addressRand['route_destination_id']; |
@@ -37,12 +37,12 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | // Mark the address as detected as visited |
| 39 | 39 | $addressParameters=(array)Address::fromArray(array( |
| 40 | - "route_id" => $routeId, |
|
| 41 | - "route_destination_id" => $address_id, |
|
| 40 | + "route_id" => $routeId, |
|
| 41 | + "route_destination_id" => $address_id, |
|
| 42 | 42 | )); |
| 43 | 43 | |
| 44 | 44 | $body= array( |
| 45 | - "is_visited" => TRUE, |
|
| 45 | + "is_visited" => TRUE, |
|
| 46 | 46 | ); |
| 47 | 47 | |
| 48 | 48 | $address = new Address(); |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
| 5 | -require $root . '/vendor/autoload.php'; |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | +require $root.'/vendor/autoload.php'; |
|
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
| 8 | 8 | use Route4Me\Route; |
@@ -36,12 +36,12 @@ discard block |
||
| 36 | 36 | assert(!is_null($address_id), "can't retrieve random address"); |
| 37 | 37 | |
| 38 | 38 | // Mark the address as detected as visited |
| 39 | -$addressParameters=(array)Address::fromArray(array( |
|
| 39 | +$addressParameters = (array)Address::fromArray(array( |
|
| 40 | 40 | "route_id" => $routeId, |
| 41 | 41 | "route_destination_id" => $address_id, |
| 42 | 42 | )); |
| 43 | 43 | |
| 44 | -$body= array( |
|
| 44 | +$body = array( |
|
| 45 | 45 | "is_visited" => TRUE, |
| 46 | 46 | ); |
| 47 | 47 | |
@@ -29,10 +29,10 @@ |
||
| 29 | 29 | $address=new Address(); |
| 30 | 30 | |
| 31 | 31 | $params = array( |
| 32 | - "route_id" => $routeId, |
|
| 33 | - "address_id" => $route_destination_id, |
|
| 34 | - "is_departed" => 1, |
|
| 35 | - "member_id" => 1 |
|
| 32 | + "route_id" => $routeId, |
|
| 33 | + "address_id" => $route_destination_id, |
|
| 34 | + "is_departed" => 1, |
|
| 35 | + "member_id" => 1 |
|
| 36 | 36 | ); |
| 37 | 37 | |
| 38 | 38 | $result = $address->markAsDeparted($params); |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
| 5 | -require $root . '/vendor/autoload.php'; |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | +require $root.'/vendor/autoload.php'; |
|
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
| 8 | 8 | use Route4Me\Address; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | assert(!is_null($route_destination_id), "can't retrieve random address"); |
| 27 | 27 | |
| 28 | 28 | // Mark the address as deoarted |
| 29 | -$address=new Address(); |
|
| 29 | +$address = new Address(); |
|
| 30 | 30 | |
| 31 | 31 | $params = array( |
| 32 | 32 | "route_id" => $routeId, |