PowerSolver Docs
Back to Wizard
This page belongs to the full documentation. You don't need it to plan: back to the essentials.

PowerSolver 2.0 — Quick Reference

The cheat sheet. For the full picture see Concepts Guide.


Top-level JSON skeleton

{
  "problemType": "task-assignment",          // descriptive label
  "collections": {
    "resources": [ /* host items */ ],
    "tasks":     [ /* entity items */ ]
  },
  "variables": [
    {"id": "schedule", "type": "list", "on": "resources", "valueRange": "tasks"}
  ],
  "shadows": [
    {"on": "tasks", "name": "previous", "kind": "previousElement", "source": "schedule"},
    {"on": "tasks", "name": "host",     "kind": "inverseRelation", "source": "schedule"}
  ],
  "derivedShadows": [
    {"on": "tasks", "name": "startTime",
     "sources": ["previous.endTime", "host.startTime"],
     "expression": "previous?.endTime ?? host.startTime"},
    {"on": "tasks", "name": "endTime",
     "sources": ["startTime", "this.duration"],
     "expression": "startTime + this.duration"}
  ],
  "constraints": [
    {"name": "All tasks scheduled", "type": "hard", "rule": "unassigned_count",
     "params": {"inverse_field": "host"}, "weight": 100},
    {"name": "High-priority first", "type": "soft", "rule": "minimize_property",
     "params": {"property": "priority"}, "weight": 1}
  ],
  "config": {"timeoutSeconds": 5}
}

Variable types

TypeUse forMandatory fieldsAuto-rejected
listScheduling, routing, sequencing (anything with order).id, type, on, valueRangechained (gone in 2.0)
basicOne-to-one assignment without ordering.id, type, on, valueRangechainedConfig, anchorRange, nodeRange

Built-in shadow kinds

KindReturns
previousElementThe element before this one in its host's list (or null).
nextElementThe element after this one (or null).
inverseRelationThe host that owns this element's list.
index0-based position in the host's list.

Expression DSL (for derivedShadows[].expression)

ConstructExample
Property pathprevious.endTime, host.startTime, this.duration
Null-safe accessprevious?.endTime
Null-coalesceprevious?.endTime ?? host.startTime
ArithmeticstartTime + this.duration, cumulative + this.weight
Grouping(a + b) * c

Supported value types: Number, Duration, LocalDateTime. Every path used must appear in sources.


Constraint rules (current 2.0 vocabulary)

type (hard/soft) is set per constraint — it's not fixed by the rule. The Typical column is just the common choice.

RuleTypicalParamsNotes
unassigned_counthard{"variable_field": "<var>"} or {"inverse_field": "host"}Forces every entity to get a value. ALWAYS include one per variable — otherwise the solver "solves" by leaving everything unassigned. Use variable_field for basic variables, inverse_field for sequence/list mode.
no_conflicthard{"fields": ["<var>", ...]}No two entities share the same combination of values (no double-booking).
skill_matchhard{"variable_field","entity_property","value_property"}Assigned value must hold the entity's required capability. Requirement may be scalar or a list (value must hold all; empty = anyone).
resource_exclusivityhard{"variable_field","entity_property","value_property"}Inverse of skill_match: a specialised value only hosts an entity that needs it.
resource_unavailablehard{"variable_field","slot_field","slot_property","unavailable_property"}Resource can't take a slot it's unavailable for.
protected_slothard{"variable_field","value_property"}No entity assigned a value whose boolean value_property is true.
no_subject_repeat_per_dayhard{"group_property","category_property","slot_field","day_property"}A group can't repeat a category on the same day.
capacityhard{"variable_field","capacity_property","load_property"?}Summed load per resource ≤ its capacity; penalises excess. load_property defaults to 1/entity.
time_windowhard{"variable_field","value_property","entity_start_property","entity_end_property"}Assigned slot time must fall in the entity's [start,end]. ISO-8601 / numeric.
precedencehard{"slot_field","value_property","depends_on_property"}If B depends on A, A's slot must be strictly before B's.
load_balancesoft{"variable_field": "<var>"}Spreads entities evenly across a variable's values.
minimize_propertysoft{"property": "<name>"}Minimises the sum of a numeric property (static or derived shadow).
costsoft{"variable_field","rate_property","quantity_property"?,"scale"?}Minimises Σ(value rate × entity quantity), read through the variable. scale normalises money magnitude; both optional, default 1.
preferencesoft{"variable_field","entity_property","value_property"}Penalises mismatch between the assigned value's stated preference and the entity. Scalar or list; weight = strength.

Sequences and times along a route are expressed with a list variable and derived shadows, not with dedicated rules.


Score shape

0hard/-12soft
  • Read left-to-right: hard tally first, then soft.
  • 0hard ⇒ feasible. Any negative hard ⇒ infeasible.
  • The 2.0 score type is HardSoftScore (no medium band).

API — POST /api/solve

Request: full §5bis JSON (the skeleton above).

Response (synchronous, completes within the configured timeoutSeconds budget):

{
  "score": "0hard/-6soft",
  "feasible": true,
  "assignments": {
    "R1": ["T1", "T2", "T3"]      // ordered list per host
  },
  "shadows": {                     // present iff the problem has element shadows
    "T1": {
      "previous": null,
      "host":     "R1",
      "startTime": "2026-06-01T08:00",
      "endTime":   "2026-06-01T08:30"
    }
  }
}

Entity-typed shadows (previous / next / host) emit element/host ids. LocalDateTime / Duration / numbers emit their ISO/string form. null stays null.

Error responses

StatusCause
400Schema validation failed (missing collections, invalid variable type, malformed derived-shadow expression, v1 shape detected).
500Solver exception or internal error.
501Feature not implemented (rare — only constraint rules outside the 2.0 vocabulary).

Wizard cheat sheet

StepWhat you do
0AI Intake (optional, the GenAI front door) — answer 5 plain-language questions, confirm PowerAI's interpretation of each (HITL), then Generate. PowerAI emits a full §5bis spec that pre-fills Steps 1–7. Skip to author manually.
1Load a plan from Excel (Setup sheet: lists, decisions, reference lists, settings; then Fill all steps now or step by step), Download workbook template, ⓘ — or pick a problem type + toggle Sequence Mode on (most schedulers / routers) or off (pure assignment).
2Define entities — the things being scheduled (with duration, priority, …). Upload Excel / CSV, Paste, or the workbook banner's Import.
3Define variables + value-range items (the hosts), and the reference lists (data rules read, never decided). In sequence mode, pick the host fact and apply the default derived-shadow template.
4Add constraints — at minimum a hard unassigned_count for any list variable. Import / Download rules (Excel).
5(Optional) Pinned assignments — decisions already taken for some items (all their decisions). Never decided for any item → reference list instead.
6Solver config — timeoutSeconds (default 30).
7Can this work? (red / amber / green, optional quick plan), review the JSON, then Plan it.

Hostnames + ports (production)

ServiceHostnamePort
Solver APIhttps://api.planningpowertools.com8001
Wizard UIhttps://wizard.planningpowertools.com8080
Admin APIhttps://admin-api.planningpowertools.com8010
AI APIhttps://powerai-api.planningpowertools.com8060
Orchestratorhttps://orchestrator-api.planningpowertools.com8050

Common file paths

WhatWhere
Solver API sourceD:\PowerProjects\PowerSolver\powersolver-api\
Wizard sourceD:\PowerProjects\PowerSolver\powersolver-wizard\
§5bis starter templatesD:\PowerProjects\PowerSolver\timefold-templates\sequence\
Test corpusD:\PowerProjects\PowerSolver\powersolver-api\test-cases\
Deploy scriptsD:\PowerProjects\documentation\installation\
DocumentationD:\PowerProjects\PowerSolver\documentation\