Examples of TimedEvent


Examples of eu.ha3.matmos.engine.core.implem.TimedEvent

       
        if (serial.event != null)
        {
          for (SerialMachineEvent eelt : serial.event)
          {
            events.add(new TimedEvent(
              eelt.event, this.providers.getEvent(), eelt.vol_mod, eelt.pitch_mod, eelt.delay_min,
              eelt.delay_max, eelt.delay_start));
          }
        }
       
View Full Code Here

Examples of ptolemy.actor.util.TimedEvent

        Time currentTime = getDirector().getModelTime();
        _currentOutput = null;

        if (_delayedOutputTokens.size() > 0) {
            TimedEvent earliestEvent = (TimedEvent) _delayedOutputTokens.get();
            Time eventTime = earliestEvent.timeStamp;

            if (eventTime.equals(currentTime)) {
                _currentOutput = (Token) earliestEvent.contents;
                output.send(0, value.getToken());
View Full Code Here

Examples of ptolemy.actor.util.TimedEvent

        }

        // handle the refiring of the multiple tokens
        // that are scheduled to produce at the same time.
        if (_delayedOutputTokens.size() > 0) {
            TimedEvent earliestEvent = (TimedEvent) _delayedOutputTokens.get();
            Time eventTime = earliestEvent.timeStamp;

            if (eventTime.equals(currentTime)) {
                getDirector().fireAt(this, currentTime);
            }
        }

        // Schedule a future firing to process the current input.
        if (_currentInput != null) {
            _delayedOutputTokens.put(new TimedEvent(delayToTime, value
                    .getToken()));
            getDirector().fireAt(this, delayToTime);
        }

        return super.postfire();
View Full Code Here

Examples of ptolemy.actor.util.TimedEvent

        Time currentTime = getDirector().getModelTime();
        _currentOutput = null;

        if (_delayedOutputTokens.size() > 0) {
            if (currentTime.compareTo(_nextTimeFree) == 0) {
                TimedEvent earliestEvent = (TimedEvent) _delayedOutputTokens
                        .get();
                Time eventTime = earliestEvent.timeStamp;

                if (!eventTime.equals(currentTime)) {
                    throw new InternalErrorException("Timer time is "
View Full Code Here

Examples of ptolemy.actor.util.TimedEvent

            // NOTE: the input has a fixed data type as double.
            DoubleToken delayToken = (DoubleToken) _delayedInputTokensList
                    .removeFirst();
            double delay = delayToken.doubleValue();
            _nextTimeFree = currentTime.add(delay);
            _delayedOutputTokens.put(new TimedEvent(_nextTimeFree, value
                    .getToken()));
            getDirector().fireAt(this, _nextTimeFree);
        }

        return !_stopRequested;
View Full Code Here

Examples of ptolemy.actor.util.TimedEvent

        // is delayed to the next available firing at the current time.
        Time currentTime = getDirector().getModelTime();
        _currentOutput = null;

        if (_delayedOutputTokens.size() > 0) {
            TimedEvent earliestEvent = (TimedEvent) _delayedOutputTokens.get();
            Time eventTime = earliestEvent.timeStamp;

            if (eventTime.equals(currentTime)) {
                _currentOutput = (Token) earliestEvent.contents;
                output.send(0, _currentOutput);
View Full Code Here

Examples of ptolemy.actor.util.TimedEvent

        }

        // Handle the refiring of the multiple tokens
        // that are scheduled to be produced at the same time.
        if (_delayedOutputTokens.size() > 0) {
            TimedEvent earliestEvent = (TimedEvent) _delayedOutputTokens.get();
            Time eventTime = earliestEvent.timeStamp;

            if (eventTime.equals(currentTime)) {
                getDirector().fireAt(this, currentTime);
            }
        }

        // Process the current input.
        if (_currentInput != null) {
            _delayedOutputTokens
                    .put(new TimedEvent(delayToTime, _currentInput));
            getDirector().fireAt(this, delayToTime);
        }

        return super.postfire();
    }
View Full Code Here

Examples of ptolemy.actor.util.TimedEvent

        if (newFiringTime.compareTo(getModelTime()) < 0) {
            throw new IllegalActionException(this, "The process wants to "
                    + " get fired in the past!");
        }

        _eventQueue.put(new TimedEvent(newFiringTime, actor));
        _informOfDelayBlock();

        try {
            while (getModelTime().compareTo(newFiringTime) < 0) {
                wait();
View Full Code Here

Examples of ptolemy.actor.util.TimedEvent

            // Artificial deadlock due to delayed processes.
            // Advance time to next possible time.
            synchronized (this) {
                if (!_eventQueue.isEmpty()) {
                    //Take the first time-blocked process from the queue.
                    TimedEvent event = (TimedEvent) _eventQueue.take();

                    //Advance time to the resumption time of this process.
                    setModelTime(event.timeStamp);
                    _informOfDelayUnblock();
                } else {
                    throw new InternalErrorException("Inconsistency"
                            + " in number of actors blocked on delays count"
                            + " and the entries in the CalendarQueue");
                }

                //Remove any other process waiting to be resumed at the new
                //advanced time (the new currentTime).
                boolean sameTime = true;

                while (sameTime) {
                    //If queue is not empty, then determine the resumption
                    //time of the next process.
                    if (!_eventQueue.isEmpty()) {
                        //Remove the first process from the queue.
                        TimedEvent event = (TimedEvent) _eventQueue.take();
                        Actor actor = (Actor) event.contents;

                        //Get the resumption time of the newly removed
                        //process.
                        Time newTime = event.timeStamp;

                        //If the resumption time of the newly removed
                        //process is the same as the newly advanced time
                        //then unblock it. Else put the newly removed
                        //process back on the event queue.
                        if (newTime.equals(getModelTime())) {
                            _informOfDelayUnblock();
                        } else {
                            _eventQueue.put(new TimedEvent(newTime, actor));
                            sameTime = false;
                        }
                    } else {
                        sameTime = false;
                    }
View Full Code Here

Examples of rinde.sim.scenario.TimedEvent

        .neededCapacity(0)
        .arrivalTime(2400)
        .pickupDuration(200)
        .deliveryDuration(800)
        .build()));
    sb.addEvent(new TimedEvent(PDPScenarioEvent.TIME_OUT, 200000));

    final VanLon14Scenario s = sb
        .build(new ScenarioCreator<VanLon14Scenario>() {
          @Override
          public VanLon14Scenario create(List<TimedEvent> eventList,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.