Giter Site home page Giter Site logo

janpalasek / job-shop-scheduling Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 2.0 97 KB

Implementation of job-shop scheduling problem using C#.

License: MIT License

C# 100.00%
job-shop job-shop-scheduling job-shop-scheduling-problem genetic-algorithm c-sharp job-scheduling

job-shop-scheduling's Introduction

job-shop-scheduling

This repository is an implementation of job-shop scheduling problem using C#. Algorithm is described here.

CircleCI

How to run the project

Command-line arguments:

  • Path to the input file (file from which the job shop input will be loaded) = -f or --file (required)
  • Number of threads that will be used = -t or --threads (optional)
  • Number of generations of GA = -g or --gen (optional)
  • Number of iterations of GA = -i or --it (optional)

If value for optional argument is not specified, default value defined in Config class will be used.

Example:

dotnet JobShopScheduling.dll --file="Examples/la19.in" --threads=4

The program will output three files into the execution directory:

  1. {inputFileName}.log - contains all logs from evaluation,
  2. {inputFileName}.svg - plot showing progression of the best individual,
  3. {outputFileName}.out - contains the best schedules found both for the adaptive and non-adaptive algorithm and their lengths. The schedule is described as list of machines and their operations in the order of the execution.

Schedule example:

...
Machine 0: 0 8 6
Machine 1: ...
...

This describes that on machine 0 the first operation executing will be the operation 0, then 8, then 6,...

Input file

Input file is expected to have first line specifying jobs and machines count in the following format.

{jobs count} {machines count}

Every new line specifies new jobs operations and costs.

{machine ID} {cost} {machine ID} {cost} ...

Example of input file:

3 3
0 2 1 3 2 1
1 13 2 10 0 1
1 2 0 3 2 3

The example input file specifies, that number of jobs is 3 and number of machines is also 3. Additionally, the first job has three operations, where the first must be performed on machine 0 and has cost 2, the second one must be performed on the 1st machine and has cost 3 and the third one must be performed on 2nd machine and must have cost 1, the second job has three operations, where the first one must be performed on 1st machine and has cost 13, etc.

Further constraints have on the input file have to be met:

  1. Machine IDs have to be indexed from 0 to M-1 continuously, where M is number of machines (e.g. there must not be machine 1 missing in between machine 0 and machine 2, and there must not be machine 0 missing in the data),
  2. each machine has to have at least 3 operations,
  3. each job has to have at least 3 operations.

Libraries used:

For the genetic algorithm evaluation:

Others:

job-shop-scheduling's People

Contributors

janpalasek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

job-shop-scheduling's Issues

There is no Gene on index 4 to be replaced.

Hi!
I'm getting an error There is no Gene on index 4 to be replaced.. Is it because my input data is not symmetrical? how to deal with uneven jobs?

INPUT DATA

10 6
1  11  5  12
2  10  5  15
1  10  4  15
3  3  4  5  6  1
2  12  5  13  6  11
3  2  6  3
2  8  4  6
2  11  6  12
2  5  3  6  4  4
1  4  3  3  5  2

STACKTRACE:

STACKTRACE:
   at GeneticSharp.Domain.Chromosomes.ChromosomeBase.ReplaceGene(Int32 index, Gene gene)
   at JobShopScheduling.GeneticAlgorithm.ScheduleChromosome.FixChromosome() in C:\Users\Adam\Downloads\job-shop-scheduling-master\JobShopScheduling\GeneticAlgorithm\ScheduleChromosome.cs:line 104
   at JobShopScheduling.GeneticAlgorithm.ScheduleFitness.Evaluate(ScheduleChromosome chromosome) in C:\Users\Adam\Downloads\job-shop-scheduling-master\JobShopScheduling\GeneticAlgorithm\ScheduleFitness.cs:line 31
   at JobShopScheduling.GeneticAlgorithm.ScheduleFitness.Evaluate(IChromosome chromosome) in C:\Users\Adam\Downloads\job-shop-scheduling-master\JobShopScheduling\GeneticAlgorithm\ScheduleFitness.cs:line 20
   at GeneticSharp.Domain.GeneticAlgorithm.RunEvaluateFitness(Object chromosome)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.