Linear programming Xpress

Document ID: [01PECOV]
Revision Level: [Released]
Last Revision: [A]

Project Description
Software and architecture of automation

Politecnico di Torino
s192891@studenti.polito.it

Project Description
Version 1.0 / 3-3-2014

Presenter
Name
Department
E-mail

Reviewer
Jiawei Wu
Name

Automatica e Informatica Department
s192891@studenti.polito.it E-mail

Marco Ghirardi
Automatica e Informatica
marco.ghirardi@polito.it

Document ID: [01PECOV]
Revision Level: [Released]
Last Revision: [A]

DOCUMENT HISTORY
Revision

Date

Change

Author


0.1

2/23/2014

Jia Wei, Wu

0.2

3/2/2014

1.0

3/3/2014

Create document structure
Add chapter 1.1 problem analysis
Add chapter 1.2 linear programming
Add chapter 2.1.1 relative function definition
Add chapter 2.1.2 characteristic of scheduler
Add chapter 3.1 computational result

Fill chapter 2.1.2 characteristics of schedule
Fill the table of computational result
Conclude

Jia Wei, Wu

Jia Wei, Wu

Document ID: [01PECOV]
Revision Level: [Released]
Last Revision: [A]



MODELLING ............................................................................................................ 1 
1.1 
PROBLEM ANALYSIS......................................................................................................... 1 
1.1.1  Data size and generation instances ................................................................................ 1 
1.1.2  Data characteristics ..................................................................................................... 1 
1.1.3  Parallel machines ......................................................................................................... 1 

1.2 
LINEAR PROGRAMMING ................................................................................................... 2 
1.2.1  Objective function......................................................................................................... 2 
1.2.2  Constraints .................................................................................................................. 2 



SCHEDULER DESIGN ............................................................................................ 3 
2.1 
DEVELOPMENT METHODOLOGY........................................................................................ 3 
2.1.1  Relative function definition ............................................................................................ 3 
2.1.2  Characteristic of Scheduler ........................................................................................... 4 



TEST AND PERFORMANCE .................................................................................. 6 
3.1 

COMPUTATIONAL RESULT ................................................................................................ 6 


Document ID: [01PECOV]
Revision Level: [Released]
Last Revision: [A]

1 Modelling
1.1 Problem Analysis
1.1.1

Data size and generation instances
The data instances given include: 1 medium and 3 large ones, and data size
distributes as following:
 M1: 60 Jobs
 L1: 125 Jobs
 L2: 145 Jobs
 L3: 160 Jobs
The jobs created dynamically over time, selecting stochastic during the operation
in simulation, based on the random generation seed varying from 1 to 3.

Figure 1 Generation configuration interface
1.1.2


Data characteristics
Consider the data structure in given file, jobs are indicated as [JobType
CreationTime ReleaseTime], differing in the job types, various routing sequences
are existence as following:
 Sequence: 1-2-3-4-5-6 for job types from 1 to 4
 Sequence: 1-2-3-7-8-9 for job types from 5 to 8
 Sequence: 4-5-6 for job types from 9 to 14
 Sequence: 7-8-9 for job types from 15 to 20
Here, it conceals a condition that, for each jobs approaching, the scheduler must
check the parameter of “JobType” to dispatch in different sequences.

1.1.3

Parallel machines
Inside the schema of machines, here are three parallel machines, composed by
two identical parallel machines ( Pj | rj | C max ), the processing time of the job is the

same on the two machines. Here, when the job arriving, based on given
sequences, it will be assigned to the first available machine. Meanwhile, sorting

the jobs in order of “starting time” at the end of output function.

1
This document can only be presented during the exam of software architecture of automation. Other activities, such as, copied,
modified, printed, posted and distributed to others are not allowed by author – Jia Wei, Wu (s192891@studenti.polito.it).

Document ID: [01PECOV]
Revision Level: [Released]
Last Revision: [A]

Figure 2 Machines schema

1.2 Linear Programming
1.2.1

Objective function
Definition of makespan:

Cmax  Ci , j , i, j   


(1.1)

Here, i indicates each job, j represents each machine, Ci , j is the completion time
on each machine for each job.
1.2.2

Constraints
Case for single machines:
 Sequence: 1-2-3-4-5-6

C1, j  rj  p1, j , j   
C2, j  C1, j  p2, j

C3, j  C2, j  p3, j

C4, j  C3, j  p4, j

(1.2)

C5, j  C4, j  p5, j



C6, j  C5, j  p6, j

Sequence: 1-2-3-7-8-9

C1, j  rj  p1, j , j   
C2, j  C1, j  p2, j

C3, j  C2, j  p3, j

C7, j  C3, j  p7, j

(1.3)

C8, j  C7, j  p8, j
C9, j  C8, j  p9, j
2

This document can only be presented during the exam of software architecture of automation. Other activities, such as, copied,

modified, printed, posted and distributed to others are not allowed by author – Jia Wei, Wu (s192891@studenti.polito.it).

Document ID: [01PECOV]
Revision Level: [Released]



Last Revision: [A]

Sequence: 4-5-6

C4, j  rj  p4, j , j   
C5, j  C4, j  p5, j



C6, j  C5, j  p6, j

Sequence: 7-8-9


(1.4)

C7, j  rj  p7, j , j   
C8, j  C7, j  p8, j
C9, j  C8, j  p9, j

(1.5)

Ck,i  pk ,i  Ck, j  Myi , j  M  xi  x j  2hi , j  , k  3, 6,9, j   

Case for parallel machines:

Ck, j  pk , j  Ck,i  My j,i  M  xi  x j  2hj,i 
yi , j  1  y j ,i

(1.6)

hi , j  h j ,i

hi , j  xi , hi , j  x j , hi , j  xi  x j  1

2

Scheduler Design

2.1 Development methodology
2.1.1

Relative function definition
Using omnet library to run a Mosel file, which comprising the state of the system
and problem data, named “State.txt”, it is automatically generated by the
simulator and readable by Xpress.

Figure 3 Run Mosel in Omnet
3
This document can only be presented during the exam of software architecture of automation. Other activities, such as, copied,
modified, printed, posted and distributed to others are not allowed by author – Jia Wei, Wu (s192891@studenti.polito.it).

Document ID: [01PECOV]
Revision Level: [Released]
Last Revision: [A]

At each polling, and check the system state, compute the sequences of jobs for
each machine to return to the simulator. Here, I define a polling counter to check
if there is a new job generated.
Inside Xpress coding, reading system state and job information from “State.txt”
file, initializing parameters.

Figure 4 Read source file and initialize parameters
After appropriate inspection of job and machine status, with proper rescheduling
manipulation, output the solution file.

Figure 5 Output solution file
2.1.2

Characteristic of Scheduler
Due to the capability of programming skills, I choose Omnet++ plus Xpress, to
use Omnet to run Mosel and call the solver for simulation. Inside Xpress, reading
the system and job status, reschedule the job sequences, and output a solution to
send to Omnet. If there is no job generated, the final solution will be generated.

Characteristics:
 Polling counter
Defining a polling counter to return to run Mosel
PolCount = 400




Maximum simulation time
Define parameters for the time limitation for solver of Xpress
MaxTime = 40
Function of verification of Job processing
This approach is from professor, to check the job processing position,
meanwhile to decide the sequence of job processing.
4

This document can only be presented during the exam of software architecture of automation. Other activities, such as, copied,
modified, printed, posted and distributed to others are not allowed by author – Jia Wei, Wu (s192891@studenti.polito.it).

Document ID: [01PECOV]
Revision Level: [Released]
Last Revision: [A]

Figure 6 Function of dispatcher for job sequences


Define a limitation bound
Define a variable to limit the size of job in each time will be processed in
the solver. Here I set the value to 50, I test the performance of 50, 60, the
response is similar.

Figure 7 Definition of limitation bound

Figure 8 Boundary condition


Define disjunctive constraints for parallel machines
Based on the condition in constraints which are defined in 1.2.2, here, I
add a constraints for parallel machines. Before, I put all of this constraints
outside codes, the performance is not good, and always frozen due to the
reason of infeasible solution.

5
This document can only be presented during the exam of software architecture of automation. Other activities, such as, copied,
modified, printed, posted and distributed to others are not allowed by author – Jia Wei, Wu (s192891@studenti.polito.it).

Document ID: [01PECOV]
Revision Level: [Released]
Last Revision: [A]

Figure 9 Definition of disjunctive constraints
3

Test and Performance

3.1 Computational result
SEED 
  
DET 
SEED=1 
SEED=2 
SEED=3 
AVG 

LARGE1 
9560.0000
9541.7210
9572.0438
9581.9299
9563.923675

INSTANCE 
LARGE2 
10977.0000
10951.2885
10982.9646
11004.5400
10978.94828

LARGE3 
11098.0000
11104.9655
11136.7293
11189.0428
11132.1844

Table 1 Makespan distribution

6
This document can only be presented during the exam of software architecture of automation. Other activities, such as, copied,
modified, printed, posted and distributed to others are not allowed by author – Jia Wei, Wu (s192891@studenti.polito.it).