// ------------ Switching and setting current rows
SUMOTime
MSAgentbasedTrafficLightLogic::trySwitch(bool) throw() {
    assert(getCurrentPhaseDef().minDuration >=0);
    assert(getCurrentPhaseDef().minDuration <= getCurrentPhaseDef().duration);
    if (myPhases[myStep]->isGreenPhase()) {
        // collects the data for the signal control
        collectData();
        // decides wheter greentime shall distributed between phases
        if (tDecide <= tSinceLastDecision) {
            calculateDuration();
        }
    }
    // increment the index to the current phase
    nextStep();
    // set the next event
    while (getCurrentPhaseDef().duration==0) {
        nextStep();
    }
    assert(myPhases.size()>myStep);
    return getCurrentPhaseDef().duration;
}
Beispiel #2
0
void AlbumTrack::setSound(FMOD::Sound* sound)
{
    this->sound = sound;
    this->title = parseTitle(sound);
    calculateDuration();
}