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, withLevelpublic 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)
IObjectivecontext - The ThreadContextpublic void init(ThreadContext context)
IObjectivecontext - The ThreadContext.public IObjective createNew()
IObjectiveIObjective. If it returns the same instance, all the methods has to be thread
save as they are called concurrently.public boolean isHardObjective()
IObjectiveIObjective.satisifiesHardObjective(Double) is called.IObjective.satisifiesHardObjective(Double),
IObjectivepublic boolean satisifiesHardObjective(java.lang.Double fitness)
IObjectivefitness - The fitness value of a solution.IObjective