Interface PlanningSolutionMetaModel<Solution_>
- Type Parameters:
Solution_- the type of the solution
- All Known Implementing Classes:
DefaultPlanningSolutionMetaModel
@NullMarked
public interface PlanningSolutionMetaModel<Solution_>
Represents the meta-model of a
PlanningSolution.
Allows access to information about all the entities and variables.
This package and all of its contents are part of the Neighborhoods API, which is under development and is only offered as a preview feature. There are no guarantees for backward compatibility; any class, method, or field may change or be removed without prior notice, although we will strive to avoid this as much as possible.
We encourage you to try the API and give us feedback on your experience with it, before we finalize the API. Please direct your feedback to Timefold Solver GitHub or to Timefold Discord.
-
Method Summary
Modifier and TypeMethodDescriptionentities()Returns the meta-models ofplanning entitiesknown to the solution, genuine or shadow.default <Entity_> PlanningEntityMetaModel<Solution_,Entity_> Returns the meta-model of theplanning entitywith the given class.default List<GenuineEntityMetaModel<Solution_,?>> Returns the meta-models of genuineplanning entitiesknown to the solution.default <Entity_> GenuineEntityMetaModel<Solution_,Entity_> genuineEntity(Class<Entity_> entityClass) Returns the meta-model of thegenuine planning entitywith the given class.default booleanChecks whether anPlanningEntity-annotated class is known by the solution.static <Solution_>
PlanningSolutionMetaModel<Solution_>Creates aPlanningSolutionMetaModelbased on the given solution class and entity classes.default List<ShadowEntityMetaModel<Solution_,?>> Returns the meta-models of shadowplanning entitiesknown to the solution.default <Entity_> ShadowEntityMetaModel<Solution_,Entity_> shadowEntity(Class<Entity_> entityClass) Returns the meta-model of theshadow planning entitywith the given class.type()Returns the class of the solution.
-
Method Details
-
of
static <Solution_> PlanningSolutionMetaModel<Solution_> of(Class<Solution_> solutionClass, Class<?>... entityClasses) Creates aPlanningSolutionMetaModelbased on the given solution class and entity classes.- Type Parameters:
Solution_- the type of the solution- Parameters:
solutionClass- the solution classentityClasses- all entities used in the solution, genuine and shadow- Returns:
- the solution meta-model
-
type
Returns the class of the solution.- Returns:
- never null, the type of the solution
-
entities
List<PlanningEntityMetaModel<Solution_,?>> entities()Returns the meta-models ofplanning entitiesknown to the solution, genuine or shadow.- Returns:
- Entities declared by the solution.
-
genuineEntities
Returns the meta-models of genuineplanning entitiesknown to the solution.- Returns:
- Entities declared by the solution, which declare some genuine variables.
-
shadowEntities
Returns the meta-models of shadowplanning entitiesknown to the solution.- Returns:
- Entities declared by the solution, which do not declare any genuine variables.
-
entity
Returns the meta-model of theplanning entitywith the given class.- Parameters:
entityClass- Expected class of the entity.- Returns:
- An entity declared by the solution.
- Throws:
IllegalArgumentException- wherehasEntity(Class)would have returned false.
-
genuineEntity
default <Entity_> GenuineEntityMetaModel<Solution_,Entity_> genuineEntity(Class<Entity_> entityClass) Returns the meta-model of thegenuine planning entitywith the given class.- Parameters:
entityClass- Expected class of the entity.- Returns:
- An entity declared by the solution.
- Throws:
IllegalArgumentException- wherehasEntity(Class)would have returned false, or where the entity is a shadow entity.
-
shadowEntity
Returns the meta-model of theshadow planning entitywith the given class.- Parameters:
entityClass- Expected class of the entity.- Returns:
- An entity declared by the solution.
- Throws:
IllegalArgumentException- wherehasEntity(Class)would have returned false, or where the entity is a genuine entity.
-
hasEntity
Checks whether anPlanningEntity-annotated class is known by the solution.- Returns:
- True if known, false otherwise.
- See Also:
-