Newly Pregnant Mom

    @andreybutenko/dutyscheduler

    1.0.2 • Public • Published

    Duty Scheduler

    A Javascript library for creating duty schedules. View on NPM and install with:

    npm i @andreybutenko/dutyscheduler

    Example Code

    const DutySet = require('./models/DutySet.js');
    const Person = require('./models/Person.js');
    
    const dutySet = new DutySet(6, 2);
    dutySet.addPerson(new Person('Andrey', [false, true, true, true, false, true], dutySet));
    dutySet.addPerson(new Person('Korra', [true, false, false, false, true, true], dutySet));
    dutySet.addPerson(new Person('Anna', [false, true, false, true, false, false], dutySet));
    
    console.log('SCHEDULE: \n', dutySet.calculateSchedule());
    console.log('AVAILABILITIES: \n', dutySet.getAvailabilities());

    Result

    SCHEDULE:
     [ [ 'Korra', 'Andrey' ],
      [ 'Andrey', 'Anna' ],
      [ 'Anna', 'Andrey' ],
      [ 'Andrey', 'Korra' ],
      [ 'Korra', 'Anna' ],
      [ 'Anna', 'Korra' ] ]
    AVAILABILITIES:
     [ [ 'Korra' ],
      [ 'Andrey', 'Anna' ],
      [ 'Andrey' ],
      [ 'Andrey', 'Anna' ],
      [ 'Korra' ],
      [ 'Andrey', 'Korra' ] ]
    

    Install

    npm i @andreybutenko/dutyscheduler

    DownloadsWeekly Downloads

    0

    Version

    1.0.2

    License

    Apache-2.0

    Unpacked Size

    27.5 kB

    Total Files

    10

    Last publish

    Collaborators

    • andreybutenko