text: // load general framework code
  self.importScripts("../lib/seedrandom.min.js", "../lib/rand.js", "../lib/EventList.js",
      "../lib/math.js", "../lib/idb5.js");
  self.importScripts("../OESjs-Core1/OES-Foundation.js", "../OESjs-Core1/simulator.js");
  // load simulation-example-specific code
  self.importScripts("simulation.js");
  if (sim.model.objectTypes) {
    sim.model.objectTypes.forEach( function (objT) {
      self.importScripts( objT + ".js");
    });
  }
  if (sim.model.eventTypes) {
    sim.model.eventTypes.forEach( function (evtT) {
      self.importScripts( evtT + ".js");
    });
  }
  // start simulation on message from main thread
  onmessage = function (e) {
    var scenario={};
    if (sim.experimentType) {
      // when experimentType has been set, run it
      sim.runExperiment( sim.experimentType);
    } else if (e.data.simToRun) {
      // assign alternative scenario, if selected
      if (e.data.scenarioNo !== undefined && sim.scenarios[e.data.scenarioNo]) {
        scenario = sim.scenarios[e.data.scenarioNo];
        // copy simulation end time from base scenario if not provided
        if (!scenario.durationInSimTime && !scenario.durationInSimSteps && !scenario.durationInCpuTime) {
          if (sim.scenario.durationInSimTime) {
            scenario.durationInSimTime = sim.scenario.durationInSimTime;
          } else if (sim.scenario.durationInSimSteps) {
            scenario.durationInSimSteps = sim.scenario.durationInSimSteps;
          } else if (sim.scenario.durationInCpuTime) {
            scenario.durationInCpuTime = sim.scenario.durationInCpuTime;
          }
        }
        sim.scenario = scenario;
      }
      if (e.data.simToRun === "0") {
        sim.runStandaloneScenario( e.data.createLog);
        // send statistics to main thread
        self.postMessage({statistics: sim.stat, endTime: sim.endTime});
      } else {
        let expNo = parseInt( e.data.simToRun) - 1;
        sim.experimentType = sim.experimentTypes[expNo];
        sim.experimentType.storeExpResults = e.data.storeExpRes;
        sim.runExperiment();
      }
    }
  };