From b85cbe74e0277b5fa53058f4038077b7c8ad36c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Galland?= Date: Tue, 9 Oct 2018 17:44:46 +0200 Subject: [PATCH] [sre] Use the new functions of Time capacity for implementing the time supports into the Schedules BIC. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Galland --- .../src/io/janusproject/kernel/bic/SchedulesSkill.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/SchedulesSkill.java b/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/SchedulesSkill.java index 0cc02dc71e..f1fbb56cf8 100644 --- a/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/SchedulesSkill.java +++ b/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/SchedulesSkill.java @@ -236,7 +236,7 @@ public AgentTask in(AgentTask task, long delay, Procedure1 proced synchronized (getTaskListMutex()) { pair = preRunTask(task, procedure); } - final long osDelay = Math.round(getTimeSkill().getOSTimeFactor() * delay); + final long osDelay = Math.round(getTimeSkill().toOSDuration(delay)); final AgentTask runnableTask = pair != null ? pair.getTask() : task; final ScheduledFuture sf = this.executorService.schedule( new AgentTaskRunner(runnableTask, false), @@ -414,7 +414,7 @@ public AgentTask every(AgentTask task, long period, Procedure1 pr synchronized (getTaskListMutex()) { description = preRunTask(task, procedure); } - final long osPeriod = Math.round(getTimeSkill().getOSTimeFactor() * period); + final long osPeriod = Math.round(getTimeSkill().toOSDuration(period)); final AgentTask runnableTask = description != null ? description.getTask() : task; final ScheduledFuture sf = this.executorService.scheduleAtFixedRate( new AgentTaskRunner(runnableTask, true), @@ -438,7 +438,7 @@ public AgentTask atFixedDelay(AgentTask task, long delay, Procedure1 future; - final long osDelay = Math.round(getTimeSkill().getOSTimeFactor() * delay); + final long osDelay = Math.round(getTimeSkill().toOSDuration(delay)); if (osDelay <= 0) { future = this.executorService.submit(new AgentInfiniteLoopTask(runnableTask)); } else {