Job Sequencing
Job Sequencing
Job Sequencing
ABSTRACT
2. INTRODUCTION
The m number of sites and n number of jobs are given as input on C program
console. In a text file the time taken by each job at each site will be taken in the form of
2D matrix by a C program. The optimal sequence and its time will be displayed as output
on console.
optimal sequence
by the algorithm of job sequencing with deadlines
by the Job shop scheduling algorithm
by the Johnsons algorithm for job sequencing
Functional Requirements:
Initializing the parameters
If no data is inserted, the system shall display the warning statement, to insert the data.
An error message must be displayed for any kind of functional errors.
The system has to check if the entered card is a valid data.
If the inserted data is valid the system should accept the data and perform the prescribed
algorithm.
The output is however shown on the console, hence there is no other special requirement
regarding the interface.
Nonfunctional Requirements:
Usability Requirement
The system shall allow the users to access the system from the console itself. And of
course can be developed with a console based application. Presently, it uses the C console
as an interface.
Availability Requirement
The system is available 100% for the user and can be used now and then. The system
shall be operational always in any kind of supporting environment.
Efficiency Requirement
Mean Time to Repair (MTTR) The chances of failure are very less in this system.
Even if the system fails, the system will be recovered back up with a reinstallation of
Turbo C.
Accuracy
The system shall accurately provide all the real time information taking into
consideration various concurrency issues. The system shall provide 100% access
reliability.
Performance Requirement
The information is refreshed at regular intervals depending upon whether some updates
have occurred or not. The system shall respond to the member in not less than two
seconds from the time of the request submittal when all the hardware and software
requirements are satisfied coherently. Since, it is just a language compiler. Apparently, the
system shall be allowed to take more time when doing large processing jobs. Responses
to view information shall take no longer than 5 seconds to appear on the screen.
Reliability Requirement
The system shall be 100% reliable due to the importance of data and the damages that can
be caused by incorrect or incomplete data. There is no problem in running the system not
ceased for a much longer time.
Hardware Requirements:
Software Requirements:
4. ANALYSIS
5
4.1. Introduction
The Analysis Phase is where the project lifecycle begins. The Analysis Phase is where we
break down the deliverables in the high-level Project Charter into the more detailed
requirements. The Analysis Phase is also the part of the project where we identify the
overall direction that the project will take through the creation of the project strategy
documents. Gathering requirements is the main attraction of the Analysis Phase.
This project is divided into two different modules.
4.3. Conclusion:
The process of gathering requirements is usually more than simply asking the users what
they need and writing their answers down. Depending on the complexity of the
application, the process for gathering requirements has a clearly defined process of its
own. This process consists of a group of repeatable processes that utilize certain
techniques to capture, document, communicate, and manage requirements.
5. DESIGN
5.1. Introduction
The Design phase is when you build the plan for how you will take your project through
the rest of the SDL processfrom implementation, to verification, to release. During the
Design phase you establish best practices to follow for this phase by way of functional
and design specifications, and you perform risk analysis to identify threats and
vulnerabilities in your software.
This Project contains two types of design diagrams.
UML Diagrams:
The Unified
Modeling
Language (UML)
is
general-purpose,
In this the structural and behavioral as parts of the system are represented
as they are to be built.
Usecase diagram
Sequence diagram
Collaboration diagram
Activity diagram
10
Usecase Diagram:
Usecase diagrams are a set of use cases, actors and their relationships. They represent the
use case view of a system.
A usecase represents a particular functionality of a system.
So usecase diagram is used to describe the relationships among the functionalities and
their internal/external controllers. These controllers are known as actors.
In this project there are 2 actors user and system. The functionalities of each actor are
represented in usecase.
11
Sequence Diagram:
A sequence diagram is an interaction diagram. From the name it is clear that the diagram
deals with some sequences, which are the sequence of messages flowing from one object
to another.
Interaction among the components of a system is very important from implementation
and execution perspective.
So Sequence diagram is used to visualize the sequence of calls in a system to perform a
specific functionality.
In this project the interaction between user and system is represented as shown in below
sequence diagram.
12
Collaboration Diagram:
Collaboration diagram is another form of interaction diagram. It represents the structural
organization of a system and the messages sent/received. Structural organization consists
of objects and links.
The purpose of collaboration diagram is similar to sequence diagram. But the specific
purpose of collaboration diagram is to visualize the organization of objects and their
interaction.
In this project the objects are user and system visualizes the organization and interaction
between them.
13
Activity Diagram:
Activity diagram describes the flow of control in a system. So it
consists of activities and links. The flow can be sequential, concurrent
or branched.
Activities are nothing but the functions of a system. Numbers of activity diagrams are
prepared to capture the entire flow in a system.
14
Activity diagrams are used to visualize the flow of controls in a system. This is prepared
to have an idea of how the system will work when executed.
In this project the activity diagram shows the sequential flow functions/activities.
The coding phase aims at translating the design created into a set of programs in
some given programming language, so that the design can be implemented in the most
efficient manner. This phase affects the subsequent phases, such as testing and
maintenance, acutely. While coding, the focus has to be on minimizing testing and
maintenance effort. All endeavors while coding should stand for simplicity and easily
understandable.
The Implementation phase is when the end user of your software is foremost in
your mind. During this phase you create the documentation and tools the customer uses
to make informed decisions about how to deploy your software securely. To this end, the
Implementation phase is when you establish development best practices to detect and
remove security and privacy issues early in the development cycle.
16
standard library will be used extensively throughout this text; it is important to avoid
writing your own code when a correct and portable implementation already exists.
A C program, whatever its size, consists of functions and variables. A function contains
statements that specify the computing operations to be done, and variables store values
used during the computation.
The following program is the traditional first program presented in introductory C
courses and textbooks.
1 /* First C program: Hello World */
2 #include
3
4 int main(void)
5{
6
7}
6.3. Algorithm:
Input: Number of sites, number of jobs and the text file name are the inputs for this
project.
17
Step1: Construct the text file in the form of matrix a[i][j].Rows indicate the sites (m) and
columns indicate the jobs (n), the values indicate the time taken by each job at each site.
Step2: Enter the number of sites and number of jobs on console.
Step3: Enter the text file name on console.
Step4: The value a[i+1] will be compared with a[j+1] in the matrix.
If a[j+1] is greater than a[i+1] then for a[i+1][j+1] the a[j+1] value will be added and
stored in a[i+1][j+1].
If a[i+1] is greater than a[j+1] then for a[i+1][j+1] the a[i+1] value will be added and
stored in a[i+1][j+1].
Step5: This process will be continued until the last value in matrix a[m][n].
Step6: The optimal sequence and total time of completion will be displayed on console.
Output: the total number of permutations, optimal sequence and its time are the outputs.
6.4. Implementation
Sample Code in C:
#include<stdio.h>
#include<conio.h>
18
#include<malloc.h>
#define maxsites 20
#define maxjobs 15
19
void addlist(){
if (head==NULL)
return;
else {
head1=head;
20
21
void computeprevjobs(){
struct node *temp,*temp1;
long int prev,i;
temp=head;
for(i=0;i<noofjobs;i++)
before[i] = -1;
while(temp != NULL) {
temp1 = temp;
prev = temp->val -1;
for(i=0;i<(prev+1);i++)
if (before[i]==-1)
before[i] = i-1;
temp=temp->nextlist;
}
22
}
void calctimematrix(){
long int i,j,k,n,p,m;
long int x;
n = noofpermutations();
for(m=0;m<n;m++){
totalcost=0;
for(j=0;j<noofsites;j++)
{
for(k=0;k<noofjobs;k++)
{
cost[b[m][j]-1][k] = costx[b[m][j]-1][k];
/*
printf("$%d ",cost[b[m][j]-1][k]);*/
}
}
for (i=1;i<noofjobs;i++) {
cost[b[m][0]-1][i] += cost[b[m][0]-1][i-1];
/*
printf("jobs %d",cost[b[m][0]-1][i]);*/
}
for (i=1;i<noofsites;i++)
{cost[b[m][i]-1][0] += cost[b[m][i-1]-1][0];
23
/*
printf("sites %d",cost[b[m][i]-1][0]);*/
}
for(j=1;j<noofsites;j++)
for(k=1;k<noofjobs;k++)
{
if (cost[b[m][j]-1][k-1] > cost[b[m][j-1]-1][k])
x = cost[b[m][j]-1][k-1];
else
x = cost[b[m][j-1]-1][k];
cost[b[m][j]-1][k] += x;
/*
printf("#%d ",cost[b[m][j]-1][k]); */
totalcost = cost[b[m][j]-1][k];
/*printf("\n total time = %d",totalcost);*/
}
/* printf("\n This permutation number : %d whose cost is %d",b[m][r],totalcost);*/
if (totalcost < leastcost)
{
leastcost=totalcost;
/* printf("\n Least cost changed to : %d",leastcost); */
leastcostperm=m;
24
void enterjobspersite(){
long int i, j;
long int a[6][6];
char filename[100];
25
FILE *file1;
clrscr();
printf("Please enter file name (W/O .txt): ");
scanf("%s", filename);
for(i=0;i<noofsites;i++){
for(j=0;j<noofjobs;j++){
fscanf(file1,"%d\t", &S[i][j]);
costx[i][j] = S[i][j];
/*
printf("*%d ",costx[i][j]); */
}
}
}
long int noofpermutations()
{ long int permutations=1,x;
for(x=1;x<=noofsites;x++)
permutations=permutations*x;
return permutations;
26
}
void store()
{ long int x;
/*printf("\n in store %d",bctr+1);*/
for(x=0;x<noofsites;x++)
b[bctr][x]=a[x];
/*totaltime[bctr]=0; */
bctr++;
count++;
}
void permute()
{ long int x,y;
while(count<noofpermutations())
{ for(y=0;y<noofsites-1;y++)
{ swap(&a[y],&a[y+1]);
store();
}
swap(&a[0],&a[1]);
store();
for(y=noofsites-1;y>0;y--)
{ swap(&a[y],&a[y-1]);
27
store();
}
swap(&a[noofsites-1],&a[noofsites-2]);
store();
}
}
void printperm(){
long int i,j,n;
n=noofpermutations();
for(i=0;i<n;i++)
{for(j=0;j<noofsites;j++)
printf("%d ",b[i][j]);
printf("\n");
}
}
main() {
long int x;
char ans;
clrscr();
printf("Enter no. of sites : ");
scanf("%d",&noofsites);
28
if(noofsites<=0)
{
printf("sites cant be zero or less than zero");
exit(1);
}
else
printf("Enter no. of jobs : ");
scanf("%d", &noofjobs);
if(noofjobs<=0)
{
printf("jobs can't be zero or less than zero");
exit(2);
}
/*printf("Processing sites..."); */
for(x=0;x<noofsites;x++)
a[x] = x+1;
/*printf("\n Entering costs per job.."); */
enterjobspersite();
computeprevjobs();
29
30
31
6.6. Conclusion
32
The time taken for a job to complete at a particular site values will be given in a
text file as input. When this text file name is given on console the program will be
executed and the total permutations, optimal sequence and total time taken for all jobs to
complete will be given as output on console.
If the same problem would have solved by hand, it would have taken approximately 3
years to find the optimal sequence after implementing all the sequences manually. To
perform a general mathematical calculation to find out the optimal sequence for the
above problem, it took about two hours for us. Through the algorithm of job sequencing
with deadlines may face the delay time during processing. In Job shop scheduling, it is
very hard to schedule due to high product variability and twisted production flow.
Moreover capacity utilization is very low compared to the job sequencing algorithm.
7. TESTING
33
7.1. Introduction
Software Testing is a critical element of software quality assurance and represents
the ultimate review of specification, design and coding, Testing presents an interesting
anomaly for the software engineer.
Testing Objectives include:
1. Testing is a process of executing a program with the intent of finding an error.
2. A good test case is one that has a probability of finding an as yet undiscovered
error.
3. A successful test is one that uncovers an undiscovered error.
Testing Principles
1. All tests should be traceable to end user requirements.
2. Tests should be planned long before testing begins.
3. Testing should begin on a small scale and progress towards testing in large
Exhaustive testing is not possible.
4. To be most effective testing should be conducted by an independent third party.
Testing Strategies
A Strategy for software testing integrates software test cases into a series of well
planned steps that result in the successful construction of software. Software testing is a
broader topic for what is referred to as Verification and Validation. Verification refers to
the set of activities that ensure that the software correctly implements a specific function
Validation refers he set of activities that ensure that the software that has been built is
traceable to customers requirements.
34
This program is limited for only 6 sites when the hardware contains 4GB RAM.
Greater than 6 sites will give the error in output. If number of sites input is given as 0 or
less than 0 than the output will be sites cant be zero or less than zero and if number of
jobs input is given as 0 or less than 0 than output will be jobs cant be zero or less than
0 on console.
7.3. Conclusion
35
A test case, in software engineering, is a set of conditions under which a tester will
determine whether an application, software system or one of its features is working as it was
originally established for it to do. The mechanism for determining whether a software program or
system has passed or failed such a test is known as a test oracle. In some settings, an oracle could
be a requirement or use case, while in others it could be a heuristic. It may take many test cases to
determine that a software program or system is considered sufficiently scrutinized to be released.
Test cases are often referred to as test scripts, particularly when written - when they are usually
collected into test suites.
8. CONCLUSION
36
The entire project has been developed and deployed as per the requirements stated
by the user, it is found to be bug free as per the testing standards that are implemented.
Any specification-untraced errors will be concentrated in the coming versions, which are
planned to be developed in near future. The system at present does not take care of the
money payment methods, as the consolidated constructs need SSL standards and are
critically to be initiated in the first face; the application of the credit card transactions is
applied as a developmental phase in the coming days. The system needs more
elaborative technicality for its inception and evolution.
9. BIBLIOGRAPHY
Text Book References:
Software Engineering
37
Pressman
Programming in C
Balaguruswamy
Internet References:
http://www-personal.acfr.usyd.edu.au/tbailey/ctext/ctext.pdf
http://www1.ximb.ac.in/users/fac/Surya/surya.nsf/23e5e39594c064ee8
52564ae004fa010/0f776dc7f3fe2550652574e2002240df/$FILE/N
%20jobs%20and%20M-%20Machine%20Problem.pdf
http://www.airccse.org/journal/ijdps/papers/0512ijdps25.pdf
https://en.wikipedia.org/wiki/Johnson%27s_rule
http://www.geeksforgeeks.org/job-sequencing-problem-set-1-greedyalgorithm/
38