In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to use JAVA to solve the job shop scheduling problem". In the daily operation, I believe many people have doubts about how to use JAVA to solve the job shop scheduling problem. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for everyone to answer the doubts about "how to use JAVA to solve the job shop scheduling problem". Next, please follow the editor to study!
Code framework
The code is divided into five packages, the first part Data is the various structures used, the second part GA is the GA part + the first TS, the third part is the main function, and the fourth and fifth parts are two TS.
The examples are placed in the input folder, where a series of Mk examples, a series of Kacem examples and a simple example test.txt in this paper are prepared.
Main
Example input:
There is also a function output as CSV in Main, which requires a jar package, which has been placed in the download link and can be deleted by students who do not need it.
Data
A mess of structures. Let's talk a little bit about the Solution class and the Graph class.
The Solution class contains several print functions, including drawing a Gantt chart and whether the checksolution is legal or not.
OperationMatrix is the theme of the solution, which stores the start and end time of a certain process of a workpiece, and the processing machine in which it is located.
The Graph class represents a disjunctive graph. NodeList is the node on each machine. Among them, the starting point and the ending point are extracted separately and set up two classes. Graph also includes the Bellman algorithm for obtaining DFS of critical path and update starting time & end time.
GA
The MyHybridAlgorithm class is the main function of GA. The editor conducts a variety of tests during implementation, such as disturbing when the number of iterations of noImprove reaches limit:
Which Tabu to choose:
Readers should pay attention to it when reading.
I have initialized all the parameters related to the algorithm. Please find and modify them yourself:
Crossover, mutation and other operations are included in the ChromosomeOperation class. The function for calculating fitness is in the CaculateFitness class, and the TabuSearch2 class is based on coding tabu, which is not shown here.
NeighbourSearch
This package contains tabu based on disjunctive graphs. The NeighbourAlgorithms class is equivalent to Main and contains functions that convert the solution to a graph:
The TabuSearch3 class is the tabu main function. The NeighbourGraph class stores the solution generated by the neighborhood search of disjunctive graph.
PM, PJ, SM and SJ represent the corresponding points of precede, succeed, machine and job, while DeleteNeighbourGraphics represent the deleted points.
There is also the binary search function of findLandR position and the valuation function of insert:
NeighbourSearch3
This package is the third tabu based on Gantt Chart.
The RTS class is the main function of tabu. The solution is expressed in the form of ArrayList.
The replan function contains a method to update the solution after performing a swap operation on the Gantt chart, with detailed notes:
At this point, the study on "how to use JAVA to solve the job shop scheduling problem" is over. I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.