Package com.google.ortools.bop
Enum BopParameters.ThreadSynchronizationType
- java.lang.Object
-
- java.lang.Enum<BopParameters.ThreadSynchronizationType>
-
- com.google.ortools.bop.BopParameters.ThreadSynchronizationType
-
- All Implemented Interfaces:
com.google.protobuf.Internal.EnumLite,com.google.protobuf.ProtocolMessageEnum,java.io.Serializable,java.lang.Comparable<BopParameters.ThreadSynchronizationType>
- Enclosing class:
- BopParameters
public static enum BopParameters.ThreadSynchronizationType extends java.lang.Enum<BopParameters.ThreadSynchronizationType> implements com.google.protobuf.ProtocolMessageEnum
Defines how the different solvers are synchronized during the search. Note that the synchronization (if any) occurs before each call to an optimizer (the smallest granularity of the solver in a parallel context).
Protobuf enumoperations_research.bop.BopParameters.ThreadSynchronizationType
-
-
Enum Constant Summary
Enum Constants Enum Constant Description NO_SYNCHRONIZATIONNo synchronization.SYNCHRONIZE_ALLSynchronize all solvers.SYNCHRONIZE_ON_RIGHTSolver i synchronizes with solvers 0..i-1.
-
Field Summary
Fields Modifier and Type Field Description static intNO_SYNCHRONIZATION_VALUENo synchronization.static intSYNCHRONIZE_ALL_VALUESynchronize all solvers.static intSYNCHRONIZE_ON_RIGHT_VALUESolver i synchronizes with solvers 0..i-1.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static BopParameters.ThreadSynchronizationTypeforNumber(int value)static com.google.protobuf.Descriptors.EnumDescriptorgetDescriptor()com.google.protobuf.Descriptors.EnumDescriptorgetDescriptorForType()intgetNumber()com.google.protobuf.Descriptors.EnumValueDescriptorgetValueDescriptor()static com.google.protobuf.Internal.EnumLiteMap<BopParameters.ThreadSynchronizationType>internalGetValueMap()static BopParameters.ThreadSynchronizationTypevalueOf(int value)Deprecated.static BopParameters.ThreadSynchronizationTypevalueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)Returns the enum constant of this type with the specified name.static BopParameters.ThreadSynchronizationTypevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static BopParameters.ThreadSynchronizationType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NO_SYNCHRONIZATION
public static final BopParameters.ThreadSynchronizationType NO_SYNCHRONIZATION
No synchronization. The solvers run independently until the time limit is reached; Then learned information from each solver are aggregated. The final solution is the best of all found solutions. Pros: - No need to wait for another solver to complete its task, - Adding a new solver always improves the final solution (In the current implementation it still depends on the machine load and the time limit). Cons: - No learning between solvers.NO_SYNCHRONIZATION = 0;
-
SYNCHRONIZE_ALL
public static final BopParameters.ThreadSynchronizationType SYNCHRONIZE_ALL
Synchronize all solvers. Each solver waits for all other solvers to complete the previous optimizer run, before running again. The final solution is the best of all found solutions. Pros: - Full learning between solvers. Cons: - A lot of waiting time when solvers don't run at the exact same speed, - The quality of the final solution depends on the number of solvers, adding one more solver might lead to poorer results because the search goes on a different path.SYNCHRONIZE_ALL = 1;
-
SYNCHRONIZE_ON_RIGHT
public static final BopParameters.ThreadSynchronizationType SYNCHRONIZE_ON_RIGHT
Solver i synchronizes with solvers 0..i-1. This is a good tradeoff between NO_SYNCHRONIZATION and SYNCHRONIZE_ALL: communication while keeping a relative determinism on the result even when the number of solvers increases. The final solution is the best of all found solutions. Pros: - Solver i learns from i different solvers, - Adding a new solver always improves the final solution (In the current implementation it still depends on the machine load and the time limit). Cons: - No full learning, - Some solvers need to wait for synchronization.SYNCHRONIZE_ON_RIGHT = 2;
-
-
Field Detail
-
NO_SYNCHRONIZATION_VALUE
public static final int NO_SYNCHRONIZATION_VALUE
No synchronization. The solvers run independently until the time limit is reached; Then learned information from each solver are aggregated. The final solution is the best of all found solutions. Pros: - No need to wait for another solver to complete its task, - Adding a new solver always improves the final solution (In the current implementation it still depends on the machine load and the time limit). Cons: - No learning between solvers.NO_SYNCHRONIZATION = 0;- See Also:
- Constant Field Values
-
SYNCHRONIZE_ALL_VALUE
public static final int SYNCHRONIZE_ALL_VALUE
Synchronize all solvers. Each solver waits for all other solvers to complete the previous optimizer run, before running again. The final solution is the best of all found solutions. Pros: - Full learning between solvers. Cons: - A lot of waiting time when solvers don't run at the exact same speed, - The quality of the final solution depends on the number of solvers, adding one more solver might lead to poorer results because the search goes on a different path.SYNCHRONIZE_ALL = 1;- See Also:
- Constant Field Values
-
SYNCHRONIZE_ON_RIGHT_VALUE
public static final int SYNCHRONIZE_ON_RIGHT_VALUE
Solver i synchronizes with solvers 0..i-1. This is a good tradeoff between NO_SYNCHRONIZATION and SYNCHRONIZE_ALL: communication while keeping a relative determinism on the result even when the number of solvers increases. The final solution is the best of all found solutions. Pros: - Solver i learns from i different solvers, - Adding a new solver always improves the final solution (In the current implementation it still depends on the machine load and the time limit). Cons: - No full learning, - Some solvers need to wait for synchronization.SYNCHRONIZE_ON_RIGHT = 2;- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static BopParameters.ThreadSynchronizationType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (BopParameters.ThreadSynchronizationType c : BopParameters.ThreadSynchronizationType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static BopParameters.ThreadSynchronizationType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getNumber
public final int getNumber()
- Specified by:
getNumberin interfacecom.google.protobuf.Internal.EnumLite- Specified by:
getNumberin interfacecom.google.protobuf.ProtocolMessageEnum
-
valueOf
@Deprecated public static BopParameters.ThreadSynchronizationType valueOf(int value)
Deprecated.Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
value- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
forNumber
public static BopParameters.ThreadSynchronizationType forNumber(int value)
- Parameters:
value- The numeric wire value of the corresponding enum entry.- Returns:
- The enum associated with the given numeric wire value.
-
internalGetValueMap
public static com.google.protobuf.Internal.EnumLiteMap<BopParameters.ThreadSynchronizationType> internalGetValueMap()
-
getValueDescriptor
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()
- Specified by:
getValueDescriptorin interfacecom.google.protobuf.ProtocolMessageEnum
-
getDescriptorForType
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.ProtocolMessageEnum
-
getDescriptor
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor()
-
valueOf
public static BopParameters.ThreadSynchronizationType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
desc- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-