Results 1 to 7 of 7

Thread: Scheduler Randomizer

  1. #1
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,541

    Default Scheduler Randomizer

    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.

    Code:
    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())
    Attached Files Attached Files
    Ron
    No support through PM

  2. #2
    Join Date
    May 2004
    Posts
    2,588

    Default

    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.
    Beware of the robot.

  3. #3
    Join Date
    Mar 2007
    Posts
    14

    Default

    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:

    Code:
    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

  4. #4
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,541

    Default

    That is very odd. Did you re-run the scheduler or was that just a continuation of this scheduler started 2 days ago?
    Ron
    No support through PM

  5. #5
    Join Date
    Mar 2007
    Posts
    14

    Default

    Quote Originally Posted by Ron View Post
    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.

  6. #6
    Join Date
    Mar 2007
    Posts
    14

    Default Out of range again

    Here is a screen shot of the trigger list.
    FrontOff should be in a range of 22:00 - 23:00

    Jeff
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	timer.jpg 
Views:	160 
Size:	42.2 KB 
ID:	3703  

  7. #7
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    566

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •