-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,24 @@ | ||
# Customized constraints | ||
|
||
If no builtin constraint fit your needs, you can define your own constraint from an assertion expressed in term of [z3-solver](https://github.com/Z3Prover/z3) objects. | ||
|
||
## Customized boolean operations | ||
|
||
This is achieved by using the `ConstraintFromExpression` object. For example: | ||
|
||
``` py | ||
problem.add_constraint(t1.start == t_2.end + t_4.duration) | ||
ps.ConstraintFromExpression(expression=t1.start == t_2.end + t_4.duration) | ||
``` | ||
|
||
!!! warning | ||
|
||
A z3 ArithRef relation involved the "==" operator, used for assignement, not comparison. Your linter may complain about this syntax. | ||
|
||
You can combine the following variables: | ||
|
||
| Object | Variable name | Type | Description | | ||
| ------ | --------- | ---- | ----------- | | ||
| Task | _start | int | task start | | ||
| Task | _end | int | task end | | ||
| Task | _duration | int | can be modified only for VariableDurationTask | | ||
| Task | _scheduled | bool | can be modified only if task as been set as optional | | ||
|
||
Please refer to the [z3 solver python API](https://ericpony.github.io/z3py-tutorial/guide-examples.htm) to learn how to create ArithRef objects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
# Workflow | ||
|
||
The structure of the present documentation follows the workflow that mimics the template of a ProcessScheduler python script: | ||
The structure of this documentation is designed to mirror the typical workflow of a ProcessScheduler Python script, guiding you through each step of the scheduling process: | ||
|
||
``` mermaid | ||
graph TD | ||
A[Create a SchedulingProblem] --> B[Create objects that represent your problem]; | ||
B --> C[Constraint the schedule]; | ||
C --> D[Add objectives]; | ||
D --> E[Solve]; | ||
E --> F[Analye]; | ||
A[1. Create a SchedulingProblem] --> B[2. Create objects that represent your problem]; | ||
B --> C[3. Constraint the schedule]; | ||
C --> D[4. Add objectives]; | ||
D --> E[5. Solve]; | ||
E --> F[6. Analye]; | ||
F --> B; | ||
``` | ||
|
||
* the **[SchedulingProblem](scheduling_problem.md)** is the core container of all. | ||
1. Create a **[SchedulingProblem](scheduling_problem.md)**: This is the foundational step where you establish the SchedulingProblem, serving as the primary container for all components of your scheduling scenario. | ||
|
||
* choose among `Task` or `Resource` objects to represent the use case | ||
2. Create Objects Representing Your Problem: Select appropriate **Task** and **Resource** objects to accurately represent the elements of your use case. This step involves defining the tasks to be scheduled and the resources available for these tasks. | ||
|
||
* add temporal or logical constraints | ||
3. Apply **Constraints** to the Schedule: Introduce temporal or logical constraints to define how tasks should be ordered or how resources are to be utilized. Constraints are critical for reflecting real-world limitations and requirements in your schedule. | ||
|
||
* optiannly, add objectives if you need to find an optimal schedule according to the constraints | ||
4. Define **Objectives**: Optionally, you can specify one or more objectives. Objectives are used to determine what constitutes an 'optimal' schedule within the confines of your constraints. This could include minimizing total time, cost, or other metrics relevant to your scenario. | ||
|
||
* solve | ||
5. **Execute the Solver**: Run the solver to find a feasible (and possibly optimal, depending on defined objectives) schedule based on your tasks, resources, constraints, and objectives. | ||
|
||
* render to a Gantt chart, to Excel, whatever, and eventually return back to the representation stage. | ||
6. **Analyze** the Results: Once the solver has found a solution, you can render the schedule in various formats such as a Gantt chart or export it to Excel. This step is crucial for evaluating the effectiveness of the proposed schedule. Based on the analysis, you might revisit the representation stage to adjust your problem model, refine constraints, or alter objectives. | ||
|
||
This workflow provides a structured approach to building and solving scheduling problems using the ProcessScheduler library, ensuring that all essential aspects of your scheduling scenario are methodically addressed. |