$scheduled[$target_asn]['key'] = $target_asn;
}
echo '<pre>';
print_r($scheduled);
echo '</pre>';
$currently_running = array();
$not_covered = array();
$error = array();
$successfully_completed = array();
while (!empty($scheduled)) {
    // check whether a measurement can be started
    while (count($currently_running) == 9) {
        // query all currently running measurements whether they have stopped
        for ($i = 0; $i < 9; $i++) {
            $current_measurement_id = $currently_running[$i];
            $status = TracerouteMeasurement::get_status_by_id($current_measurement_id);
            if ($status == 'Stopped') {
                // delete measurement id from list of currently running measurements
                unset($currently_running[$i]);
                // add measurement id to list of successfully completed measurements
                $successfully_completed[] = $current_measurement_id;
            }
        }
    }
    // get next target asn (and delete from list of scheduled measurements at the same time)
    $next_target_asn_array = array_pop($scheduled);
    $next_target_asn = $next_target_asn_array['key'];
    if ($next_target_asn_array['ICMP'] || $next_target_asn_array['UDP'] || $next_target_asn_array['TCP']) {
        // get next protocol for measurement
        if ($next_target_asn_array['ICMP']) {
            $next_protocol = 'ICMP';
<?php

require 'MeasurementCampaign.php';
require 'TracerouteMeasurement.php';
require 'ASListHandler.php';
$example = new MeasurementCampaign(333, "Test", "Test");
echo 'Number of measurements for campaign ' . $example->id . ': ' . $example->get_number_of_measurements() . '<br/>';
$measurements_of_campaign = $example->get_measurement_ids();
foreach ($measurements_of_campaign as $measurement_id) {
    echo TracerouteMeasurement::get_status_by_id($measurement_id) . '<br />';
}