Class Tsmbfoa
java.lang.Object
com.adriangarcia.metaheuristics.tsmbfoa.Tsmbfoa
- All Implemented Interfaces:
Foraging
Tsmbfoa class allows the creation of an object to initiate the
bacteria foraging process for CNOP optimization.
This class is implemented by Foraging.
- Version:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionTsmbfoa()
Empty constructor method that initializes the instances of the objects used inside the class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
chemotaxis
(Configurator bacterium, Problem problem, Function function) In the chemotaxis method the chemotaxis process of TS-MBFOA is performed, where two swims are interleaved, in each cycle one exploitation or exploration swim is performed.void
eliminationDispersal
(Configurator bacterium, Problem problem, Function function) In the eliminationDispersal method, the worst bacterium is eliminated from the population based on feasibility rules and a new one is randomly generated.protected int
getCount()
Method that returns the value count.int
This method returns the generational number.protected boolean
getInstruction
(Configurator configurator) Return to TS-MBFOA stop condition.void
grouping()
The grouping method is a TS-MBFOA process, which is applied in the middle cycle of the chemotaxic process.protected void
increaseCount
(int value) This method increments an auxiliary counter for the generations.protected void
increaseGeneration
(int value) This method increases the number of TS-MBFOA generations.void
reproduction
(Configurator bacterium) In the reproduction method, the bacteria are ordered based on the constraint management technique, eliminating the worst Sb - Sr bacteria and duplicating the best ones.protected void
setCount
(int count) Method that assigns value to the count.protected void
setGeneration
(int generation) Method that assigns value to the generation.void
updateStepSize
(Configurator bacterium, Problem problem) The updateStepSize method updates the TS-MBFOA step size.
-
Constructor Details
-
Tsmbfoa
public Tsmbfoa()Empty constructor method that initializes the instances of the objects used inside the class.
-
-
Method Details
-
chemotaxis
Description copied from interface:Foraging
In the chemotaxis method the chemotaxis process of TS-MBFOA is performed, where two swims are interleaved, in each cycle one exploitation or exploration swim is performed.- Specified by:
chemotaxis
in interfaceForaging
- Parameters:
bacterium
- object of the class Configuratorproblem
- object of the class Problemfunction
- object of the class Function
-
grouping
public void grouping()Description copied from interface:Foraging
The grouping method is a TS-MBFOA process, which is applied in the middle cycle of the chemotaxic process. -
reproduction
Description copied from interface:Foraging
In the reproduction method, the bacteria are ordered based on the constraint management technique, eliminating the worst Sb - Sr bacteria and duplicating the best ones.- Specified by:
reproduction
in interfaceForaging
- Parameters:
bacterium
- object of the class Configurator
-
eliminationDispersal
Description copied from interface:Foraging
In the eliminationDispersal method, the worst bacterium is eliminated from the population based on feasibility rules and a new one is randomly generated.- Specified by:
eliminationDispersal
in interfaceForaging
- Parameters:
bacterium
- object of the class Configuratorproblem
- object of the class Problemfunction
- object of the class Function
-
updateStepSize
Description copied from interface:Foraging
The updateStepSize method updates the TS-MBFOA step size.- Specified by:
updateStepSize
in interfaceForaging
- Parameters:
bacterium
- object of the class Configuratorproblem
- object of the class Problem
-
getGeneration
public int getGeneration()This method returns the generational number. A generation consists of a a generation consists of a chemotaxis process, grouping, reproduction and elimination-dispersal.- Returns:
- the generation
-
increaseGeneration
protected void increaseGeneration(int value) This method increases the number of TS-MBFOA generations.- Parameters:
value
- generational number
-
getInstruction
Return to TS-MBFOA stop condition.- Parameters:
configurator
- object of the class Configurator- Returns:
- true or false if (counter + (sb * nc)) <= evaluations
-
increaseCount
protected void increaseCount(int value) This method increments an auxiliary counter for the generations.- Parameters:
value
- the count to set
-
setGeneration
protected void setGeneration(int generation) Method that assigns value to the generation.- Parameters:
generation
- the generation to set
-
setCount
protected void setCount(int count) Method that assigns value to the count.- Parameters:
count
- the count to set
-
getCount
protected int getCount()Method that returns the value count.- Returns:
- the count
-