ConstraintsObjective
instead.@Deprecated public class WeightedQueriesSoftObjective extends BaseObjective
fitness = sum( pattern[i].countMatches() * weight[i] )
IObjective
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_NAME
Deprecated.
|
Constructor and Description |
---|
WeightedQueriesSoftObjective()
Deprecated.
|
WeightedQueriesSoftObjective(java.util.List<org.eclipse.viatra.query.runtime.api.IQuerySpecification<? extends org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher<? extends org.eclipse.viatra.query.runtime.api.IPatternMatch>>> constraints,
java.util.List<java.lang.Double> weights)
Deprecated.
|
WeightedQueriesSoftObjective(java.lang.String name)
Deprecated.
|
WeightedQueriesSoftObjective(java.lang.String name,
java.util.List<org.eclipse.viatra.query.runtime.api.IQuerySpecification<? extends org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher<? extends org.eclipse.viatra.query.runtime.api.IPatternMatch>>> constraints,
java.util.List<java.lang.Double> weights)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
IObjective |
createNew()
Deprecated.
Returns an instance of the
IObjective . |
java.lang.Double |
getFitness(ThreadContext context)
Deprecated.
Calculates the value of the objective on a given solution (trajectory).
|
void |
init(ThreadContext context)
Deprecated.
Initializes the objective.
|
boolean |
isHardObjective()
Deprecated.
Returns true if the objective is a hard objective.
|
boolean |
satisifiesHardObjective(java.lang.Double fitness)
Deprecated.
Determines if the given fitness value satisfies the hard objective.
|
WeightedQueriesSoftObjective |
withConstraint(org.eclipse.viatra.query.runtime.api.IQuerySpecification<? extends org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher<? extends org.eclipse.viatra.query.runtime.api.IPatternMatch>> constraint,
double weight)
Deprecated.
Adds a new VIATRA Query Specification.
|
equals, getComparator, getLevel, getName, hashCode, setComparator, setLevel, toString, withComparator, withLevel
public static final java.lang.String DEFAULT_NAME
public WeightedQueriesSoftObjective(java.lang.String name, java.util.List<org.eclipse.viatra.query.runtime.api.IQuerySpecification<? extends org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher<? extends org.eclipse.viatra.query.runtime.api.IPatternMatch>>> constraints, java.util.List<java.lang.Double> weights)
public WeightedQueriesSoftObjective(java.util.List<org.eclipse.viatra.query.runtime.api.IQuerySpecification<? extends org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher<? extends org.eclipse.viatra.query.runtime.api.IPatternMatch>>> constraints, java.util.List<java.lang.Double> weights)
public WeightedQueriesSoftObjective(java.lang.String name)
public WeightedQueriesSoftObjective()
public WeightedQueriesSoftObjective withConstraint(org.eclipse.viatra.query.runtime.api.IQuerySpecification<? extends org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher<? extends org.eclipse.viatra.query.runtime.api.IPatternMatch>> constraint, double weight)
constraint
- A VIATRA Query Specification.weight
- The weight of the pattern.public java.lang.Double getFitness(ThreadContext context)
IObjective
context
- The ThreadContext
public void init(ThreadContext context)
IObjective
context
- The ThreadContext
.public IObjective createNew()
IObjective
IObjective
. If it returns the same instance, all the methods has to be thread
save as they are called concurrently.public boolean isHardObjective()
IObjective
IObjective.satisifiesHardObjective(Double)
is called.IObjective.satisifiesHardObjective(Double)
,
IObjective
public boolean satisifiesHardObjective(java.lang.Double fitness)
IObjective
fitness
- The fitness value of a solution.IObjective