PDA

View Full Version : Scheduler Randomizer



Ron
February 26th, 2007, 09:35 PM
By special request. Scheduler Randomizer to appear less scheduled.

The call

SetRandomizer( <task id>, <min>, <max>, <distribution> )

sets up the randomizer. The min and max parameters are the time in minutes that the scheduled time is supposed to vary. Distribution is the probability distribution. Currently only linear (=1) is supported but if people are interested I can add a Maxwell Boltzmann distribution or something requested.



if ( s ) then
s:Destroy()
end
s = scheduler.Create('hello', 18, false)
x = s:HourTask(1,0, scheduler.INFINITE)
print(s:SetRandomizer(x, -5,5,1))
s:Start();
table.print(s:GetTasks())

quixote
February 27th, 2007, 11:43 AM
Awesome. I can now leave for a week and not have to worry about anything but the junk mail. Now if only there was a plugin for that.
I guess I'll just have to rig up a turret with a fully-auto paintball gun and some motion sensors to keep the junk mail delivery guys at bay.

Vegas
May 7th, 2007, 08:27 AM
I started using the randomizer 2 days ago (great feature BTW) to turn off my front lights between 10 & 11pm. They went off at 10:37pm and 10:02 pm the first two days as expected.

For tonight I am getting an off time of 9:31pm.

Using the following code to set the schedule:


if ( s ) then
s:Destroy()
end
s = scheduler.Create('FrontOff', 235, false)
x = s:DayTask(1,22,30, scheduler.INFINITE)
print(s:SetRandomizer(x, -30,30,1))
s:Start();
table.print(s:GetTasks())

What I wanted was 22:30 hours +- 30 minutes. Should I be using something different for SetRandomizer(x, -?, ?,1)

Thanks

Jeff

Ron
May 7th, 2007, 08:58 PM
That is very odd. Did you re-run the scheduler or was that just a continuation of this scheduler started 2 days ago?

Vegas
May 8th, 2007, 08:34 AM
That is very odd. Did you re-run the scheduler or was that just a continuation of this scheduler started 2 days ago?

That was a continuation. Tonights scheduled time is back in range with 22:13.
This is with Girder 5 build 517.

I will keep an eye on it.

Vegas
May 10th, 2007, 06:50 AM
Here is a screen shot of the trigger list.
FrontOff should be in a range of 22:00 - 23:00

Jeff

rpalmer68
July 27th, 2007, 06:24 AM
Sorry to ask what is probably a really dumb question, but how exactly do I use this feature?

Where do I put this code and when/how do I run it?

Do I need to run it every time I reboot my PC or does it create the schedules permanently once run?

What I want to do is have my lights switch on randomly between 6pm and 7:30pm and off between 9pm and 11pm every day while I'm away on holidays.

Thanks
Richard