@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | $avoidanceZone = new AvoidanceZone(); |
32 | 32 | |
33 | -$result = (array) $avoidanceZone->addAvoidanceZone($avoidanceZoneParameters); |
|
33 | +$result = (array)$avoidanceZone->addAvoidanceZone($avoidanceZoneParameters); |
|
34 | 34 | |
35 | 35 | assert(isset($result), 'Failed to create new Avoidance Zone'); |
36 | 36 |
@@ -40,4 +40,4 @@ |
||
40 | 40 | |
41 | 41 | $problem = OptimizationProblem::optimize($optimizationParams); |
42 | 42 | |
43 | -Route4Me::simplePrint((array) $problem, true); |
|
43 | +Route4Me::simplePrint((array)$problem, true); |
@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | $territory = new Territory(); |
32 | 32 | |
33 | -$result = (array) $territory->addTerritory($TerritoryParameters); |
|
33 | +$result = (array)$territory->addTerritory($TerritoryParameters); |
|
34 | 34 | |
35 | 35 | assert(!is_null($result), "Cannot create a territory"); |
36 | 36 | assert(isset($result['territory_id']), "Cannot create a territory"); |
@@ -18,7 +18,7 @@ |
||
18 | 18 | |
19 | 19 | $randomLocation = $abLocation->getRandomAddressBookLocation($AddressBookLocationParameters); |
20 | 20 | |
21 | -if (assert(null != $randomLocation, 'Cannot get a randoma address book location')); |
|
21 | +if (assert(null!=$randomLocation, 'Cannot get a randoma address book location')); |
|
22 | 22 | |
23 | 23 | // Get the address book location by address_id |
24 | 24 | $addressID = $randomLocation['address_id']; |
@@ -28,7 +28,7 @@ |
||
28 | 28 | $address_id = $createdContact['address_id']; |
29 | 29 | } |
30 | 30 | |
31 | -assert($address_id != -1, 'Creating of Address Book Location was failed. Try again!.. <br>'); |
|
31 | +assert($address_id!=-1, 'Creating of Address Book Location was failed. Try again!.. <br>'); |
|
32 | 32 | |
33 | 33 | echo 'Address Book Location with address_id = '.strval($address_id).' was successfully added<br>'; |
34 | 34 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $address_id = $abcResult['address_id']; |
31 | 31 | } |
32 | 32 | |
33 | -assert($address_id != -1, 'Cannot create an address book location. <br><br>'); |
|
33 | +assert($address_id!=-1, 'Cannot create an address book location. <br><br>'); |
|
34 | 34 | |
35 | 35 | echo 'Address Book Location with <b>address_id = '.strval($address_id).'</b> and <b>first_name = '.$abcResult['first_name'].'</b> was successfully added<br>'; |
36 | 36 | |
@@ -40,6 +40,6 @@ discard block |
||
40 | 40 | |
41 | 41 | assert(isset($abcResult['first_name']), 'Cannot update the address book location. <br><br>'); |
42 | 42 | |
43 | -assert('Test First Name Updated' == $abcResult['first_name'], 'Cannot update the address book location. <br><br>'); |
|
43 | +assert('Test First Name Updated'==$abcResult['first_name'], 'Cannot update the address book location. <br><br>'); |
|
44 | 44 | |
45 | 45 | echo 'The field <b>first_name</b> in the address book location <b>'.$address_id.'</b> was update to <b>Test First Name Updated</b> successfuly <br>'; |
@@ -47,12 +47,12 @@ |
||
47 | 47 | |
48 | 48 | $problem = OptimizationProblem::optimize($optimizationParams); |
49 | 49 | |
50 | -foreach ((array) $problem as $key => $value) { |
|
50 | +foreach ((array)$problem as $key => $value) { |
|
51 | 51 | if (is_string($value)) { |
52 | 52 | echo $key.' --> '.$value.'<br>'; |
53 | 53 | } else { |
54 | 54 | echo "************ $key ************* <br>"; |
55 | - Route4Me::simplePrint((array) $value, true); |
|
55 | + Route4Me::simplePrint((array)$value, true); |
|
56 | 56 | echo '******************************* <br>'; |
57 | 57 | } |
58 | 58 | } |
@@ -47,12 +47,12 @@ |
||
47 | 47 | |
48 | 48 | $problem = OptimizationProblem::optimize($optimizationParams); |
49 | 49 | |
50 | -foreach ((array) $problem as $key => $value) { |
|
50 | +foreach ((array)$problem as $key => $value) { |
|
51 | 51 | if (is_string($value)) { |
52 | 52 | echo $key.' --> '.$value.'<br>'; |
53 | 53 | } else { |
54 | 54 | echo "************ $key ************* <br>"; |
55 | - Route4Me::simplePrint((array) $value, true); |
|
55 | + Route4Me::simplePrint((array)$value, true); |
|
56 | 56 | echo '******************************* <br>'; |
57 | 57 | } |
58 | 58 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $parameters->advanced_constraints[] = RouteAdvancedConstraints::fromArray([ |
51 | 51 | 'tags' => $zones[0], |
52 | 52 | '$members_count' => 3, |
53 | - 'available_time_windows' => [[(8 + 5) * 3600 , (11 + 5) * 3600]] |
|
53 | + 'available_time_windows' => [[(8 + 5) * 3600, (11 + 5) * 3600]] |
|
54 | 54 | ]); |
55 | 55 | |
56 | 56 | // Schedule 2 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $parameters->advanced_constraints[] = RouteAdvancedConstraints::fromArray([ |
60 | 60 | 'tags' => $zones[1], |
61 | 61 | '$members_count' => 3, |
62 | - 'available_time_windows' => [[(8 + 5) * 3600 , (12 + 5) * 3600]] |
|
62 | + 'available_time_windows' => [[(8 + 5) * 3600, (12 + 5) * 3600]] |
|
63 | 63 | ]); |
64 | 64 | |
65 | 65 | // Schedule 3 |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $parameters->advanced_constraints[] = RouteAdvancedConstraints::fromArray([ |
69 | 69 | 'tags' => $zones[2], |
70 | 70 | '$members_count' => 3, |
71 | - 'available_time_windows' => [[(8 + 5) * 3600 , (13 + 5) * 3600]] |
|
71 | + 'available_time_windows' => [[(8 + 5) * 3600, (13 + 5) * 3600]] |
|
72 | 72 | ]); |
73 | 73 | |
74 | 74 | //********************************************************************** |
@@ -102,12 +102,12 @@ discard block |
||
102 | 102 | |
103 | 103 | $problem = OptimizationProblem::optimize($optimizationParams); |
104 | 104 | |
105 | -echo "Optimization Problem ID: " . $problem->optimization_problem_id . PHP_EOL; |
|
106 | -echo "State: " . OptimizationStates::getName($problem->state) . " (" . $problem->state . ")" . PHP_EOL; |
|
105 | +echo "Optimization Problem ID: ".$problem->optimization_problem_id.PHP_EOL; |
|
106 | +echo "State: ".OptimizationStates::getName($problem->state)." (".$problem->state.")".PHP_EOL; |
|
107 | 107 | |
108 | -echo "Routes:" . PHP_EOL; |
|
109 | -foreach($problem->routes as $route) |
|
108 | +echo "Routes:".PHP_EOL; |
|
109 | +foreach ($problem->routes as $route) |
|
110 | 110 | { |
111 | - echo "\tID: " . $route->route_id . PHP_EOL; |
|
112 | - echo "\tDistance: " . $route->trip_distance . PHP_EOL; |
|
111 | + echo "\tID: ".$route->route_id.PHP_EOL; |
|
112 | + echo "\tDistance: ".$route->trip_distance.PHP_EOL; |
|
113 | 113 | } |