Programming Example: Accessing Excel

In this example, we will solve the familiar staff scheduling model once again.  However, to make things interesting, we will solve several, independent models in a loop.  Furthermore, the data for our models will be contained in a single Excel workbook, with each tab in the workbook storing data for an individual instance of the model.  Solutions for each site will also be returned to their respective tabs in the Excel workbook.

Suppose we have three hot dog stands:  Pluto Dogs, Saturn Dogs and Mars Dogs.  Each site has daily staffing needs that vary throughout the week.  We hire employees to work 5 continuous days in a row, followed by two days off.  As an example, an employee starting on Tuesday would be on duty Tuesday through Saturday and off Sunday and Monday, while someone starting on Friday would work Friday through Tuesday and be off Wednesday and Thursday.  We need to know how many employees to start on each day of the week at each site so as to minimize to total number of staff hired.

The data for this model may be found in the DOGS.XLS workbook contained in the Samples folder off the main LINGO folder.  If you open this workbook, you'll see there are three tabs-Pluto, Saturn and Mars.  Each tab contains the data for its particular site.  The tab for the Pluto site appears below:

dogs1

DOGS.XLS

Here we see that the Pluto site requires 10 people on Mondays, 12 on Tuesdays, and so on.  The staffing needs are also represented in the bar graph on the tab.  Similar tabs for the remaining two sites are also included in the workbook.

 

 

 

 

: