Expand description
Derive macros for SolverForge domain types.
This crate provides derive macros for implementing PlanningEntity and
PlanningSolution traits from solverforge-core.
§Example
ⓘ
use solverforge_derive::{PlanningEntity, PlanningSolution};
#[derive(PlanningEntity, Clone)]
pub struct Lesson {
#[planning_id]
pub id: String,
pub subject: String,
#[planning_variable(value_range_provider = "rooms")]
pub room: Option<Room>,
}
#[derive(PlanningSolution, Clone)]
#[constraint_provider = "define_constraints"]
pub struct Timetable {
#[problem_fact_collection]
#[value_range_provider(id = "rooms")]
pub rooms: Vec<Room>,
#[planning_entity_collection]
pub lessons: Vec<Lesson>,
#[planning_score]
pub score: Option<HardSoftScore>,
}Derive Macros§
- Planning
Entity - Derive macro for implementing the
PlanningEntitytrait. - Planning
Solution - Derive macro for implementing the
PlanningSolutiontrait.