CN108846480A - A kind of one-dimensional nesting method of more specifications and device based on genetic algorithm - Google Patents
A kind of one-dimensional nesting method of more specifications and device based on genetic algorithm Download PDFInfo
- Publication number
- CN108846480A CN108846480A CN201810620496.0A CN201810620496A CN108846480A CN 108846480 A CN108846480 A CN 108846480A CN 201810620496 A CN201810620496 A CN 201810620496A CN 108846480 A CN108846480 A CN 108846480A
- Authority
- CN
- China
- Prior art keywords
- gene
- individual
- population
- parent
- fitness
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/12—Computing arrangements based on biological models using genetic models
- G06N3/126—Evolutionary algorithms, e.g. genetic algorithms or genetic programming
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biophysics (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Theoretical Computer Science (AREA)
- Computational Linguistics (AREA)
- Molecular Biology (AREA)
- Biomedical Technology (AREA)
- Genetics & Genomics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Physiology (AREA)
- Measuring Or Testing Involving Enzymes Or Micro-Organisms (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a kind of one-dimensional nesting method of more specifications and device based on genetic algorithm, using raw material as individual, using blanking as gene, using utilization rate as fitness;Random selection all individuals of gene pairs carry out coding to form initial population, are equivalent to the integral dispensing scheme for obtaining one to all raw materials;Again using initial population as parent population, the operation of at least one of crossing operation or mutation operator and Selecting operation are carried out to parent population, until obtaining the progeny population that whole fitness meets preset condition.Artificial " greed " algorithm in compared with the prior art, the scheme for more saving raw material has been obtained from global angle, and without providing jacking scheme all on a raw material, the situation that calculating is complicated caused by avoiding when raw material tubing and blanking tubing specification are more, quantity is larger, time-consuming is more, manpower has been saved, the actual needs of Workshop Production is more met.
Description
Technical field
The present invention relates to pipe fitting manufacture fields, more particularly to a kind of one-dimensional nesting method of more specifications based on genetic algorithm
And device.
Background technique
Jacking is the common method of the industries such as mechanical processing industry, shipbuilding, when referring to blanking, in order to reduce pair
The waste of raw material, after larger or longer blanking is scheduled on raw material, some lesser blankings of reallocating, thus limited
More blankings is distributed on raw material as far as possible to be produced, the utilization rate to raw material is improved, reduces cost, economize on resources.
At present in the actual production process, jacking scheme is voluntarily calculated by worker.Worker is rule of thumb and simply
Comparison guarantees the minimal waste that single raw material tubing generates as far as possible.This is equivalent to a kind of " greed " strategy, in more raw material blankings
When, guarantee that every raw material all wastes at least to guarantee that whole wastage of material are minimum respectively, i.e., the overall situation is approached most with locally optimal solution
Excellent solution.The calculation method of this artificial " greed " do not ensure that whole jacking scheme be it is optimal, i.e., can not prove part
Optimal solution can converge to globally optimal solution.
Therefore, how from whole angle consideration nesting method, guarantee to reach as far as possible in the allocation plan of a set of raw material
Globally optimal solution is those skilled in the art's technical issues that need to address.
Summary of the invention
The object of the present invention is to provide a kind of one-dimensional nesting method of more specifications and device based on genetic algorithm, for from whole
Body angle considers nesting method, guarantees to reach globally optimal solution as far as possible in the allocation plan of a set of raw material.
In order to solve the above technical problems, the present invention provides a kind of one-dimensional nesting method of more specifications based on genetic algorithm, packet
It includes:
It is individual with raw material, using blanking as gene, each individual of gene pairs is randomly choosed in each gene and is carried out
Coding obtains the gene coding of each individual, to obtain each described individual as initial population of the gene coding;
Using the initial population as parent population, the parent population is applied in crossing operation or mutation operator at least
A kind of operation and Selecting operation, until obtaining the progeny population that whole fitness meets preset condition;
Wherein, the raw material is the tubing haveing not been cut;The blanking is to need to cut the tubing generated;The entirety is suitable
Response is the sum of the individual adaptation degree of all individuals in generation population;The individual adaptation degree is individual utilization rate;The individual
Utilization rate is the ratio that the sum of the length of all blankings distributed on the raw material accounts for the length of the raw material.
Optionally, each individual of gene pairs that randomly chooses in each gene is encoded, and is obtained each described
The gene coding of individual, specifically includes:
Calculate the default gene code length of individual;The default gene code length is that can take on the individual
The maximum value of the gene dosage of band;
Multiple groups gene is selected at random and not repeatedly, until the quantity of the gene coding generated is equal to the number of the individual
Amount;
When the length of gene coding is greater than the default gene code length, give up the gene coding;
When the length of gene coding is less than the default gene code length, with the machine transplanting of rice in gene coding
Enter space so that the length of gene coding is equal to the default gene code length.
Optionally, further include:
The sum of the length of the blanking representated by the gene that the individual carries is greater than raw material representated by the individual
When length, the individual is encoded again.
Optionally, described that the crossing operation is carried out to the parent population, specially:
Parent individuality in the parent population is ranked up by the nonincremental mode of individual adaptation degree, to adjacent father
Generation individual carries out the crossing operation as unit of gene between any two.
Optionally, described that the crossing operation is carried out as unit of gene between any two to adjacent parent individuality, specifically
Including:
Select crosspoint;
Two offspring individuals are generated by the gene before exchanging the crosspoint between two adjacent parent individualities.
Optionally, described that the mutation operator is carried out to the parent population, it specifically includes:
Randomly choose a gene;
Judge in the parent population whether to include the gene;
If it is, the step of returning to one gene of the random selection;
If it is not, then selecting a gene to be replaced in the parent population.
Optionally, it is described judge in the parent population whether include the gene before, further include:
With all gene structure balanced binary tree constructions in the parent population.
Optionally, described that the Selecting operation is carried out to the parent population, it specifically includes:
Judge whether the whole fitness of the progeny population generated is greater than the whole fitness of the parent population;
If the whole fitness of the progeny population is greater than the whole fitness of the parent population, the son is judged
Whether meet preset condition for the whole fitness of population;If it is, terminating operation;If it is not, then with the progeny population
It is right after carrying out the operation of at least one of the crossing operation or the mutation operator and the Selecting operation for parent population
New parent population and progeny population carry out whether the whole fitness for judging the progeny population generated is greater than the parent
The step of whole fitness of population;
If the whole fitness of the progeny population is less than or equal to the whole fitness of the parent population, return pair
The parent population carries out the operation of at least one of the crossing operation or the mutation operator and the Selecting operation
Step.Optionally, whether the whole fitness for judging the progeny population generated is greater than the whole of the parent population and adapts to
Degree, specifically includes:
The individual that preset quantity is selected in the progeny population calculates the individual adaptation degree of the individual of the preset quantity
The sum of obtain the sum of filial generation some individuals fitness;
The individual that the preset quantity is selected in the parent population, the individual for calculating the individual of the preset quantity are suitable
The sum of response obtains the sum of parent some individuals fitness;
Judge whether the sum of described filial generation some individuals fitness is greater than the sum of described parent some individuals fitness.
In order to solve the above technical problems, the present invention also provides a kind of one-dimensional jacking device of more specifications based on genetic algorithm,
Including:
Memory, for storing instruction, described instruction include more specifications described in above-mentioned any one based on genetic algorithm
The step of method of one-dimensional jacking;
Processor, for executing described instruction.
More specifications one-dimensional nesting method provided by the present invention based on genetic algorithm, using raw material as individual, with blanking
As gene, using utilization rate as fitness;Random selection all individuals of gene pairs carry out coding to form initial population, phase
When in obtaining an integral dispensing scheme to all raw materials;Again using initial population as parent population, parent population is answered
With the operation of at least one of crossing operation or mutation operator and Selecting operation, meet preset condition up to obtaining whole fitness
Progeny population, be equivalent to from global angle consider integral dispensing scheme superiority and inferiority, thus obtain for more specification raw materials set
The globally optimal solution of material scheme.Artificial " greed " algorithm in compared with the prior art, has obtained more saving from global angle
The scheme of raw material, and jacking scheme all on a raw material is provided without realizing, it avoids in raw material tubing and blanking tubing
The situation that calculating is complicated caused by when specification is more, quantity is larger, time-consuming is more, has saved manpower, has more met Workshop Production
Actual needs.The present invention also provides a kind of one-dimensional jacking device of more specifications based on genetic algorithm has above-mentioned beneficial effect.
Detailed description of the invention
It, below will be to embodiment or existing for the clearer technical solution for illustrating the embodiment of the present invention or the prior art
Attached drawing needed in technical description is briefly described, it should be apparent that, the accompanying drawings in the following description is only this hair
Bright some embodiments for those of ordinary skill in the art without creative efforts, can be with root
Other attached drawings are obtained according to these attached drawings.
Fig. 1 is a kind of flow chart of the one-dimensional nesting method of more specifications based on genetic algorithm provided in an embodiment of the present invention;
Fig. 2 is that one kind provided in an embodiment of the present invention randomly chooses gene in each gene to carry out gene volume to each individual
The flow chart of the specific embodiment of code;
Fig. 3 is the process for the specific embodiment that a kind of pair of parent population provided in an embodiment of the present invention carries out mutation operator
Figure;
Fig. 4 is the process for the specific embodiment that a kind of pair of parent population provided in an embodiment of the present invention carries out Selecting operation
Figure;
Fig. 5 is the stream of another specific embodiment that Selecting operation is carried out to parent population provided in an embodiment of the present invention
Cheng Tu;
Fig. 6 is a kind of structural representation of the one-dimensional jacking device of more specifications based on genetic algorithm provided in an embodiment of the present invention
Figure.
Specific embodiment
Core of the invention is to provide a kind of one-dimensional nesting method of more specifications and device based on genetic algorithm, is used for from whole
Body angle considers nesting method, guarantees to reach globally optimal solution as far as possible in the allocation plan of a set of raw material.
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
It should be noted that " one-dimensional " described in the theme of the application refers to raw material and blanking is one-dimensional tubing, only
It is allocated in the dimension of raw material length;" more specifications " refers to that the length of different raw materials may be different.
Fig. 1 is a kind of flow chart of the one-dimensional nesting method of more specifications based on genetic algorithm provided in an embodiment of the present invention.
As shown in Figure 1, the one-dimensional nesting method of more specifications based on genetic algorithm includes:
S10:It is individual with raw material, using blanking as gene, randomly chooses each individual of gene pairs in each gene and encoded,
The gene coding of each individual is obtained, to obtain each individual as initial population of gene coding.
S11:Using initial population as parent population, at least one of crossing operation or mutation operator are applied to parent population
Operation and Selecting operation, until obtaining the progeny population that whole fitness meets preset condition.
Wherein, raw material is the tubing haveing not been cut;Blanking is to need to cut the tubing generated;Whole fitness is generation kind
Individual the sum of individual adaptation degree in group;Individual adaptation degree is individual utilization rate;Individual utilization rate is to distribute on a raw material
The sum of length of blanking accounts for the ratio of the length of raw material.
For step S10, the lazy weight of for jacking raw material tubing is assumed initially that, i.e. length is not able to satisfy down
Pipe length required for expecting.Assuming that i-th raw material LiThe quantity of the blanking tubing of upper arrangement is si, then should meet:
The quantity for the blanking that can be distributed on all raw materialsNo more than the quantity n of required blanking.
In order to facilitate the operation for carrying out genetic algorithm, first data column will can be established after raw material length and cutting length sequence
Table.
Specifically, it is assumed that shared raw material m root, required blanking n root, respectively by raw material and blanking by the suitable of length non-decreasing
Sequence lines up individual data items list R [m]={ L1, L2... ... LmAnd gene data list P [n]={ I1, I2... ... In}.In this base
On plinth, LiFor i-th of individual, IjFor j-th of gene, every raw material and blanking can look in individual, gene data list
It arrives.Gene is randomly choosed in gene data list P [n], and individual is encoded with the subscript value of gene, obtains genes of individuals
Encode [a1, a2... ... ax], wherein 1≤x≤n.If genes of individuals is encoded to [a, a2, a3]=[3,0, n-1], then decoding obtains
[I4, I1, In]。
In order to reduce illegal solution, simplifies and calculate, when encoding individual, need to guarantee to select gene without repeating
It selects.
After carrying out gene coding to all individuals, initial population is generated.
For step S11, using individual utilization rate as individual adaptation degree, individual utilization rate is to distribute on a raw material
The sum of length of blanking accounts for the ratio of the length of raw material.Therefore the function of individual adaptation degree is as follows:
Wherein, LijFor the length of blanking representated by j-th of gene on i-th of individual,For i-th of individual
On all genes representated by blanking the sum of length.F (i) is the individual adaptation degree (individual utilization rate) of i-th of individual.
Maximum to the utilization rate of raw material tubing in order to realize, objective function can be:
Wherein, n0(maximum value of the quantity for the blanking that can be distributed i.e. on any raw material is no more than required blanking to≤n
Sum);Y is clout.Clout is remaining part after cutting raw material tubing, and waste material is remaining not available after cutting
Clout.This programme is according to the situation in enterprise production process, it is believed that clout of the length less than 500mm is waste material.One-dimensional jacking is asked
The optimization aim of topic is exactly to make the waste material length of every raw material tubing after blanking in the case where raw material tubing all jackings
It is minimum.But a kind of possible situation is the quantity abundance of raw material tubing, it is therefore assumed that if after certain root raw material tubing blanking
Clout length is greater than 500mm, this clout is not just waste material, moreover it is possible to make other purposes again.
In traditional genetic algorithm, from parent Evolution of Population to progeny population, Selecting operation, crossing operation common are
With three kinds of operation modes of mutation operator.It in this application, can be right in order to make population evolve to the bigger direction of whole fitness
Parent population applies the operation of at least one of crossing operation or mutation operator (the application does not limit its sequence) and Selecting operation,
Wherein, Selecting operation can use roulette algorithm, so that the individual of optimization is directly transmitted to next-generation or is incited somebody to action
The outstanding individual choice generated after crossing operation, mutation operator is to the next generation.Crossing operation is between individuals with gene
Intersected for unit.Mutation operator is the gene that selection is new from gene data list P [n], replaces the base in parent individuality
Cause.
Operation is carried out by parent population of initial population, obtains progeny population, and then can be again using progeny population as parent
Population carries out operation again and obtains new progeny population ... according to objective function (3), makes population to the maximum side of whole fitness
To evolution.It is calculated to simplify, preset condition can be whole fitness (the sum of the individual adaptation degrees of all individuals in population)
Reach preset value, is also possible to the population obtained after the calculating of preset times.
More specifications one-dimensional nesting method provided in an embodiment of the present invention based on genetic algorithm, using raw material as individual, with
Blanking is as gene, using utilization rate as fitness;Random selection all individuals of gene pairs carry out coding to form initial kind
Group, is equivalent to the integral dispensing scheme for obtaining one to all raw materials;Again using initial population as parent population, to parent kind
Group presets using the operation of at least one of crossing operation or mutation operator and Selecting operation, until obtaining whole fitness and meeting
The progeny population of condition is equivalent to the superiority and inferiority that integral dispensing scheme is considered from global angle, to obtain for more specification raw materials
Jacking scheme globally optimal solution.Artificial " greed " algorithm in compared with the prior art, has obtained more from global angle
The scheme of raw material is saved, and provides jacking scheme all on a raw material without realizing, is avoided in raw material tubing and blanking
The situation that calculating is complicated caused by when tubing specification is more, quantity is larger, time-consuming is more, has saved manpower, and it is raw more to meet workshop
The actual needs of production.
Fig. 2 is that one kind provided in an embodiment of the present invention randomly chooses gene in each gene to carry out gene volume to each individual
The flow chart of the specific embodiment of code.On the basis of the above embodiments, in another embodiment, each in step S10
It randomly chooses each individual of gene pairs in the gene to be encoded, the gene coding for obtaining each individual specifically includes:
S20:Calculate the default gene code length of individual.Default gene code length is that can carry on an individual
The maximum value of gene dosage.
S21:Multiple groups gene is selected at random and not repeatedly, until the quantity of the gene coding generated is equal to the number of individual
Amount.
S22:When the length of gene coding is greater than default gene code length, give up gene coding.
S23:When the length of gene coding is less than default gene code length, in gene coding radom insertion space with
The length for encoding gene is equal to default gene code length.
In specific implementation, individual is because operation caused by gene code length is different is inconvenient in order to prevent, by all
The gene code length of body is unified.It should be noted that gene code length refers to the quantity of the gene on an individual.
For step S20, the default gene code length of individual is calculated, that is, calculating can accommodate on an individual
Gene quantity maximum value, can specifically be calculate by the following formula to obtain:
Wherein, N is default gene code length, LmFor the maximum value of raw material length, above formula means gene is long by blanking
After the sequence of degree non-decreasing is arranged, since adding the shortest cutting length of length, until n-th blanking can not be in longest
Raw material on place until.
For step S21, multiple groups gene is selected at random and not repeatedly in the list of gene, until being all
Body is encoded.Here it not repeatedly selects, is in order to avoid generating the illegal solution for repeating blanking.
For step S22, due to being random selection gene, it is possible to choose gene code length be greater than default base
Because of code length N, need to cast out this gene coding at this time.
It,, can be with for unified operation when gene code length is less than default gene code length N for step S23
It is inserted into space in any position of gene coding, a space replaces a gene, so that gene code length is equal to default base
Because of code length N.
In order to be further reduced the illegal solution generated in gene cataloged procedure, can also include:
S24:The sum of the length of the blanking representated by the gene that individual carries is greater than the length of raw material representated by individual
When, individual is encoded again.
It should be noted that step S24 is illegally solved in addition to playing removal when carrying out gene coding, later to kind
Group intersected, mutation operator when can also be used as the illegal solution of constraint condition removal, reduce useless operation.Step S24 is specific
It can be indicated with following formula:
Wherein, IkFor in i-th of individual LiOn gene representated by blanking length.
More specifications one-dimensional nesting method provided in an embodiment of the present invention based on genetic algorithm passes through unified gene coding length
Degree removes illegal solution, ensure that the reasonability of gene coding, the operation of population during evolution after enormously simplifying.
On the basis of the above embodiments, in another embodiment, crossing operation is carried out to parent population, specially to father
Be ranked up for the parent individuality in population by the nonincremental mode of individual adaptation degree, to adjacent parent individuality between any two with
Gene is that unit carries out crossing operation.
In specific implementation, parent population progress crossing operation can be and parent individuality is lined up into a team, to adjacent
Parent individuality carries out crossing operation between any two.It, can be by parent in order to avoid generating excessive illegal solution (being such as unsatisfactory for formula (5))
Individual is ranked up by the nonincremental mode of individual adaptation degree, or parent individuality non-is passed according to the length of representative raw material
The mode of increasing sorts, and keeps the difference of adjacent parent individuality smaller, to reduce the probability for generating and illegally solving.
Crossing operation is carried out as unit of gene to adjacent parent individuality between any two, can specifically include:Selection is handed over
Crunode;Two offspring individuals are generated by the gene before exchanging crosspoint between two adjacent parent individualities.I.e. for filial generation
For, filial generation gene in front before intersection is obtained from the gene of a parent, crosspoint back gene from another
It is obtained in the gene of one parent, generates two offspring individuals by two adjacent parent individualities in this way.
Fig. 3 is the process for the specific embodiment that a kind of pair of parent population provided in an embodiment of the present invention carries out mutation operator
Figure.As shown in figure 3, on the basis of the above embodiments, in another embodiment, carrying out mutation operator to parent population, specifically
Including:
S30:Randomly choose a gene.
S31:Judge in parent population whether to include this gene;If it is, return step S30;If not, entering step
S32。
S32:A gene is selected to be replaced in parent population.
A gene is randomly choosed in gene data list P [n], computes repeatedly in order to prevent and avoids generating illegal
Whether solution carries out step S31, judge in parent population to include this randomly selected gene.If this randomly selected base
Because being not present in parent population, illustrate that this is a new gene, therefore can be by it and a gene in parent population
It is replaced, being allowed to variation is new individual.In replacement, formula (5) should be followed.Also, in order to make population to whole adaptation
It spends high direction to evolve, first can be greater than the blanking that the gene being replaced represents in the length for the blanking for judging new gene representative
Length after be replaced again.
It checks whether in parent population and may be used also before step S31 comprising this randomly selected gene for convenience
To include:
With all gene structure balanced binary tree constructions in parent population.
Specifically the subscript value of gene can be configured to balanced binary tree, make is as follows:
An empty tree is constructed first, is inserted into header element as root node, is constructed first node, is inserted into second into tree
Following inserted value is compared by a element according to the definition of ordered binary tree with nodal value, if inserted value is greater than node
Value is inserted into right subtree with regard to recurrence;If being less than nodal value, left subtree is inserted into regard to recurrence.One nodal value of every insertion just first checks
The no balance that tree is destroyed because of insertion judges that the balance factor of binary tree at this time, balance factor are nodes on binary tree
Left subtree depth subtract the value of right subtree depth, when the balance factor of binary tree is not -1,0,1, it is believed that tree is uneven, looks for
Current Minimal Not Balanced Subtree out.Under the premise of keeping binary sort tree characteristic, adjusts and respectively tied in Minimal Not Balanced Subtree
Linking relationship between point, is rotated accordingly, makes new balance subtree.Traversing all subscripts in individual
After value, a balanced binary tree construction is obtained.
The embodiment of the present invention is being checked by the way that the subscript value of gene all in parent population is configured to balanced binary tree
When whether randomly selected gene is new gene, it is more convenient the traversal to the gene of parent population.
In order to mitigate lookup pressure, can also when gene encodes, as soon as whenever choosing a gene, by it from gene data
It deletes in list P [n], is placed back in again after it is replaced.Can guarantee in this way in gene data list P [n] with
The gene that machine selects is new gene.
Fig. 4 is the process for the specific embodiment that a kind of pair of parent population provided in an embodiment of the present invention carries out Selecting operation
Figure.As shown in figure 4, on the basis of the above embodiments, in another embodiment, carrying out Selecting operation to parent population, specifically
Including:
S40:Judge whether the whole fitness of the progeny population generated is greater than the whole fitness of parent population;If
It is then to enter step S41;If it is not, then entering step S43.
S41:Judge whether the whole fitness of progeny population meets preset condition;If it is, terminating;If it is not, then
Enter step S42;
S42:After carrying out the operation of at least one of crossing operation or mutation operator as parent population using progeny population, to new
Parent population and progeny population carry out step S40;
S43:Continue to carry out the operation of at least one of crossing operation or mutation operator to parent population, subsequently into step
S40。
It should be noted that the step S42 and step S43 in the embodiment of the present invention may be considered the present invention first
A kind of situation of step S11 in embodiment.
Selecting operation be establish on the benchmark that individual adaptation degree assess, the individual of optimization be genetic directly to the next generation or
New individual, which is generated, by cross and variation is genetic to the next generation again.
In order to approach globally optimal solution, as soon as compare the whole of this progeny population whenever generating a progeny population and adapt to
The whole fitness of degree and its previous generation (parent population).If the whole fitness of this progeny population is higher, illustrate more to lean on
Nearly globally optimal solution, if its entirety fitness has not been met preset condition, just using this progeny population as parent population
The operation of at least one of crossing operation or mutation operator and Selecting operation are carried out again.If the whole fitness of parent population
It is higher, then give up the progeny population, again with parent population carry out the operation of at least one of crossing operation or mutation operator with
And Selecting operation.
Fig. 5 is the stream of another specific embodiment that Selecting operation is carried out to parent population provided in an embodiment of the present invention
Cheng Tu.As shown in figure 5, on the basis of the above embodiments, in another embodiment, step S40 is specifically included:
S50:The individual that preset quantity is selected in progeny population calculates the sum of the individual adaptation degree of the individual of preset quantity
Obtain the sum of filial generation some individuals fitness.
S51:The individual that preset quantity is selected in parent population calculates the sum of the individual adaptation degree of the individual of preset quantity
Obtain the sum of parent some individuals fitness.
S52:Judge whether the sum of filial generation some individuals fitness is greater than the sum of parent some individuals fitness.
Wherein, step S50 and step S51 out-of-order relationship, and the preset quantity in two steps is the same value.It is planting
When the individual amount of group is larger, the whole fitness of calculating is more inconvenient, therefore can be respectively in parent population and progeny population
The some individuals of random selection preset quantity calculate the sum of its individual adaptation degree, by judging the sum of filial generation some individuals fitness
With the size of the sum of parent some individuals fitness, the whole fitness and parent of progeny population can be judged to a certain extent
Relationship between the whole fitness of population, thus more easily select more preferably population as the parent kind calculated next time
Group.
Fig. 6 is a kind of structural representation of the one-dimensional jacking device of more specifications based on genetic algorithm provided in an embodiment of the present invention
Figure.As shown in fig. 6, should one-dimensional jacking device of more specifications based on genetic algorithm can because configuration or performance are different generate it is bigger
Difference, may include one or more processors (central processing units, CPU) 610 (for example, one
A or more than one processor) and memory 620, storage Jie of one or more storage application programs 633 or data 632
Matter 630 (such as one or more mass memory units).Wherein, memory 620 and storage medium 630 can be of short duration deposit
Storage or persistent storage.The program for being stored in storage medium 630 may include one or more modules (diagram does not mark), often
A module may include to the series of instructions operation in computing device.Further, processor 610 can be set to and deposit
Storage media 630 communicates, and the system in storage medium 630 is executed on the one-dimensional jacking device 600 of more specifications based on genetic algorithm
Column instruction operation.
The one-dimensional jacking device 600 of more specifications based on genetic algorithm can also include one or more power supplys 640, one
A or more than one wired or wireless network interface 650, one or more input/output interfaces 660, and/or, one or
More than one operating system 631, such as Windows ServerTM, Mac OS XTM, UnixTM,LinuxTM, FreeBSDTMDeng
Deng.
The step in the one-dimensional nesting method of more specifications described in above-mentioned Fig. 1 to Fig. 5 based on genetic algorithm is by based on something lost
The one-dimensional jacking device of more specifications of propagation algorithm is based on the structure shown in fig. 6 and realizes.
It is apparent to those skilled in the art that for convenience and simplicity of description, foregoing description based on
The one-dimensional jacking device of more specifications of genetic algorithm and the specific work process of computer readable storage medium can refer to aforementioned side
Corresponding process in method embodiment, details are not described herein.
In several embodiments provided herein, it should be understood that disclosed method, apparatus can pass through it
Its mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of module, only
A kind of logical function partition, there may be another division manner in actual implementation, for example, multiple module or components can combine or
Person is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of device or module
It connects, can be electrical property, mechanical or other forms.Module may or may not be physics as illustrated by the separation member
Upper separated, the component shown as module may or may not be physical module, it can and it is in one place, or
Person may be distributed on multiple network modules.Some or all of the modules therein can be selected according to the actual needs real
The purpose of existing this embodiment scheme.
It, can also be in addition, can integrate in a processing module in each functional module in each embodiment of the application
It is that modules physically exist alone, can also be integrated in two or more modules in a module.Above-mentioned integrated mould
Block both can take the form of hardware realization, can also be realized in the form of software function module.
If integrated module is realized and when sold or used as an independent product in the form of software function module, can
To be stored in a computer readable storage medium.Based on this understanding, the technical solution of the application substantially or
Say that all or part of the part that contributes to existing technology or the technical solution can embody in the form of software products
Out, which is stored in a storage medium, including some instructions are used so that a computer equipment
The whole of (can be personal computer, funcall device or the network equipment etc.) execution each embodiment method of the application
Or part steps.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (Read-Only Memory,
ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. are various can store program
The medium of code.
A kind of one-dimensional nesting method of more specifications and device based on genetic algorithm provided by the present invention is carried out above
It is discussed in detail.Each embodiment is described in a progressive manner in specification, the highlights of each of the examples are with other
The difference of embodiment, the same or similar parts in each embodiment may refer to each other.For device disclosed in embodiment
For, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is said referring to method part
It is bright.It should be pointed out that for those skilled in the art, without departing from the principle of the present invention,
Can be with several improvements and modifications are made to the present invention, these improvement and modification also fall into the protection scope of the claims in the present invention
It is interior.
It should also be noted that, in the present specification, relational terms such as first and second and the like be used merely to by
One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation
Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning
Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that
A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article or
The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged
Except there is also other identical elements in the process, method, article or apparatus that includes the element.
Claims (10)
1. a kind of one-dimensional nesting method of more specifications based on genetic algorithm, which is characterized in that including:
It is individual with raw material, using blanking as gene, randomly chooses each individual of gene pairs in each gene and encoded,
The gene coding of each individual is obtained, to obtain each described individual as initial population of the gene coding;
Using the initial population as parent population, at least one of crossing operation or mutation operator are applied to the parent population
Operation and Selecting operation, until obtaining the progeny population that whole fitness meets preset condition;
Wherein, the raw material is the tubing haveing not been cut;The blanking is to need to cut the tubing generated;The entirety fitness
For the sum of the individual adaptation degree of individuals all in generation population;The individual adaptation degree is individual utilization rate;The individual utilizes
Rate is the ratio that the sum of the length of all blankings distributed on the raw material accounts for the length of the raw material.
2. the one-dimensional nesting method of more specifications according to claim 1, which is characterized in that described random in each gene
Selection each individual of gene pairs is encoded, and is obtained the gene coding of each individual, is specifically included:
Calculate the default gene code length of individual;The default gene code length is that can carry on the individual
The maximum value of gene dosage;
Multiple groups gene is selected at random and not repeatedly, until the quantity of the gene coding generated is equal to the quantity of the individual;
When the length of gene coding is greater than the default gene code length, give up the gene coding;
When the length of gene coding is less than the default gene code length, radom insertion is empty in gene coding
Lattice are so that the length of gene coding is equal to the default gene code length.
3. the one-dimensional nesting method of more specifications according to claim 2, which is characterized in that further include:
The sum of the length of the blanking representated by the gene that the individual carries is greater than the length of raw material representated by the individual
When, the individual is encoded again.
4. the one-dimensional nesting method of more specifications according to claim 1, which is characterized in that described to be carried out to the parent population
The crossing operation, specially:
Parent individuality in the parent population is ranked up by the nonincremental mode of individual adaptation degree, to adjacent parent
Body carries out the crossing operation as unit of gene between any two.
5. the one-dimensional nesting method of more specifications according to claim 4, which is characterized in that described to adjacent parent individuality two
The crossing operation is carried out between two as unit of gene, is specifically included:
Select crosspoint;
Two offspring individuals are generated by the gene before exchanging the crosspoint between two adjacent parent individualities.
6. the one-dimensional nesting method of more specifications according to claim 1, which is characterized in that described to be carried out to the parent population
The mutation operator, specifically includes:
Randomly choose a gene;
Judge in the parent population whether to include the gene;
If it is, the step of returning to one gene of the random selection;
If it is not, then selecting a gene to be replaced in the parent population.
7. the one-dimensional nesting method of more specifications according to claim 6, which is characterized in that in the judgement parent population
In whether include the gene before, further include:
With all gene structure balanced binary tree constructions in the parent population.
8. the one-dimensional nesting method of more specifications according to claim 1, which is characterized in that described to be carried out to the parent population
The Selecting operation, specifically includes:
Judge whether the whole fitness of the progeny population generated is greater than the whole fitness of the parent population;
If the whole fitness of the progeny population is greater than the whole fitness of the parent population, the filial generation kind is judged
Whether the whole fitness of group meets preset condition;If it is, terminating operation;If it is not, then being father with the progeny population
After carrying out the operation of at least one of the crossing operation or the mutation operator for population, to new parent population and filial generation kind
Group carries out the step whether whole fitness for judging the progeny population generated is greater than the whole fitness of the parent population
Suddenly;
If the whole fitness of the progeny population is less than or equal to the whole fitness of the parent population, return to described
Parent population carries out the step of operation of at least one of the crossing operation or the mutation operator and Selecting operation.
9. the one-dimensional nesting method of more specifications according to claim 8, which is characterized in that the progeny population that the judgement generates
Whole fitness whether be greater than the whole fitness of the parent population, specifically include:
The individual that preset quantity is selected in the progeny population calculates the sum of the individual adaptation degree of the individual of the preset quantity
Obtain the sum of filial generation some individuals fitness;
The individual that the preset quantity is selected in the parent population calculates the individual adaptation degree of the individual of the preset quantity
The sum of obtain the sum of parent some individuals fitness;
Judge whether the sum of described filial generation some individuals fitness is greater than the sum of described parent some individuals fitness.
10. a kind of one-dimensional jacking device of more specifications based on genetic algorithm, which is characterized in that including:
Memory, for storing instruction, described instruction include described in claim 1 to 9 any one based on the more of genetic algorithm
The step of method of the one-dimensional jacking of specification;
Processor, for executing described instruction.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810620496.0A CN108846480B (en) | 2018-06-15 | 2018-06-15 | Multi-specification one-dimensional nesting method and device based on genetic algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810620496.0A CN108846480B (en) | 2018-06-15 | 2018-06-15 | Multi-specification one-dimensional nesting method and device based on genetic algorithm |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108846480A true CN108846480A (en) | 2018-11-20 |
CN108846480B CN108846480B (en) | 2022-03-25 |
Family
ID=64202006
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810620496.0A Active CN108846480B (en) | 2018-06-15 | 2018-06-15 | Multi-specification one-dimensional nesting method and device based on genetic algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108846480B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111159887A (en) * | 2019-12-27 | 2020-05-15 | 天津博迈科海洋工程有限公司 | Optimized nesting method for modular structural section |
CN111563393A (en) * | 2019-02-13 | 2020-08-21 | 杭州海康威视数字技术股份有限公司 | Method and device for adjusting modulation depth of card reader based on genetic algorithm |
CN111832725A (en) * | 2019-04-15 | 2020-10-27 | 电子科技大学 | Multi-robot multi-task allocation method and device based on improved genetic algorithm |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1431956A1 (en) * | 2002-12-17 | 2004-06-23 | Sony France S.A. | Method and apparatus for generating a function to extract a global characteristic value of a signal contents |
CN101320441A (en) * | 2008-07-18 | 2008-12-10 | 浙江大学 | Combination optimizing method facing bin packing problem |
CN103279796A (en) * | 2013-06-08 | 2013-09-04 | 苏州大学 | Method for optimizing genetic algorithm evolution quality |
CN104376369A (en) * | 2014-09-17 | 2015-02-25 | 广东工业大学 | Tire vulcanization workshop energy consumption optimization scheduling method based on hybrid genetic algorithm |
CN106934485A (en) * | 2017-01-17 | 2017-07-07 | 广东工业大学 | A kind of new one-dimensional based on genetic algorithm rehearses baiting method |
CN107153880A (en) * | 2016-03-02 | 2017-09-12 | 阿里巴巴集团控股有限公司 | One kind allots procurement practice, device and equipment |
CN108090650A (en) * | 2017-11-01 | 2018-05-29 | 南京华域云脑信息科技有限公司 | A kind of row's case optimization method based on genetic algorithm |
-
2018
- 2018-06-15 CN CN201810620496.0A patent/CN108846480B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1431956A1 (en) * | 2002-12-17 | 2004-06-23 | Sony France S.A. | Method and apparatus for generating a function to extract a global characteristic value of a signal contents |
CN101320441A (en) * | 2008-07-18 | 2008-12-10 | 浙江大学 | Combination optimizing method facing bin packing problem |
CN103279796A (en) * | 2013-06-08 | 2013-09-04 | 苏州大学 | Method for optimizing genetic algorithm evolution quality |
CN104376369A (en) * | 2014-09-17 | 2015-02-25 | 广东工业大学 | Tire vulcanization workshop energy consumption optimization scheduling method based on hybrid genetic algorithm |
CN107153880A (en) * | 2016-03-02 | 2017-09-12 | 阿里巴巴集团控股有限公司 | One kind allots procurement practice, device and equipment |
CN106934485A (en) * | 2017-01-17 | 2017-07-07 | 广东工业大学 | A kind of new one-dimensional based on genetic algorithm rehearses baiting method |
CN108090650A (en) * | 2017-11-01 | 2018-05-29 | 南京华域云脑信息科技有限公司 | A kind of row's case optimization method based on genetic algorithm |
Non-Patent Citations (1)
Title |
---|
刘亚 等: "基于遗传算法的电缆优化分割***的研究与开发", 《电力科学与工程》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111563393A (en) * | 2019-02-13 | 2020-08-21 | 杭州海康威视数字技术股份有限公司 | Method and device for adjusting modulation depth of card reader based on genetic algorithm |
CN111563393B (en) * | 2019-02-13 | 2022-07-05 | 杭州海康威视数字技术股份有限公司 | Method and device for adjusting modulation depth of card reader based on genetic algorithm |
CN111832725A (en) * | 2019-04-15 | 2020-10-27 | 电子科技大学 | Multi-robot multi-task allocation method and device based on improved genetic algorithm |
CN111832725B (en) * | 2019-04-15 | 2023-05-26 | 电子科技大学 | Multi-robot multi-task allocation method and device based on improved genetic algorithm |
CN111159887A (en) * | 2019-12-27 | 2020-05-15 | 天津博迈科海洋工程有限公司 | Optimized nesting method for modular structural section |
CN111159887B (en) * | 2019-12-27 | 2024-03-19 | 天津博迈科海洋工程有限公司 | Optimized nesting method for module structural section bar |
Also Published As
Publication number | Publication date |
---|---|
CN108846480B (en) | 2022-03-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Wardlaw et al. | Evaluation of genetic algorithms for optimal reservoir system operation | |
CN108846480A (en) | A kind of one-dimensional nesting method of more specifications and device based on genetic algorithm | |
CN103902375B (en) | A kind of cloud method for scheduling task based on improved adaptive GA-IAGA | |
US9172614B2 (en) | Network capacity management system and method | |
Rahimi-Vahed et al. | A novel hybrid multi-objective shuffled frog-leaping algorithm for a bi-criteria permutation flow shop scheduling problem | |
CN104932938A (en) | Cloud resource scheduling method based on genetic algorithm | |
CN104915817A (en) | Loading method and apparatus for container | |
CN109447264B (en) | Virtual machine placement genetic optimization method based on VHAM-R model in cloud computing environment | |
CN104036324B (en) | Optimal design method of communication network capacity based on genetic algorithm | |
CN110162388A (en) | A kind of method for scheduling task, system and terminal device | |
CN105843666B (en) | Based on the virtual machine placement method of multiple-objection optimization in cloud computing | |
CN109546646A (en) | A kind of region power spot market distributing goes out clearing method, device, equipment and medium | |
JP6724576B2 (en) | Multi-target optimization method and apparatus | |
CN104618134B (en) | A kind of multistage light splitting passive optical network optimization method of power distribution communication net | |
CN106484512A (en) | The dispatching method of computing unit | |
CN109255513A (en) | A kind of power telecom network scene work order dispatching method | |
CN107046501A (en) | For SDN determining method of path, device, computer equipment and storage medium | |
CN108882256A (en) | A kind of wireless sensor network node coverage optimization method and device | |
CN110519090A (en) | A kind of accelerator card distribution method, system and the associated component of FPGA cloud platform | |
CN108809860B (en) | Network node resource allocation method based on service reliability | |
Djedović et al. | Optimization of business processes by automatic reallocation of resources using the genetic algorithm | |
CN106959886A (en) | A kind of deploying virtual machine control platform and application method based on cloud computing | |
TWI740895B (en) | Distribution method and device for application attribution service cluster | |
Yao et al. | Hybrid evolutionary approaches to terminal assignment in communications networks | |
Al Jadaan et al. | Enhancing data selection using genetic algorithm |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |