|
|
|
|
|
|
Login
|
erp5.org has permanently moved to wiki.erp5.org ! Current status of ERP5 community websites:
Note: if you created content in this ancient portal, please migrate it to the wiki. The old website will stay online as long as all contents are not mograted to the wiki.
ERP5 Simulation Model
General PresentationThe Movement class allows to implement ERP5 universal accounting model. Movement instances are used in different situations:
For example, the following objects are Orders:
Orders allow to describe a target, but can not be used to account the reality of actual transfered quantities. This is not the case for Deliveries:
For simple planning, we use a simple approach. Deliveries contain a reference to an order (causality) 2 quantities:
When quantity and target_quantity, the delivery can be closed. When quantity and target_quantity is different, a new delivery is created with 0 quantity and target_quantity = target_quantity - quantity. This simple system allows to delivery goods of a single order in multiple times, and to keep track of deliveries without any complex planning system. It is the basis of ERP5 trade module. If we need to implement more complex planning, such as in a production workshop, we can not use such a simple model. We have to implement a planning system. The approach in ERP5 is based on "simulation". In this case, target_quantity becomes meaningless. For complex planning, the following approach is used instead.1- Movements from an order are never modified once the order is confirmed. This is a rule. An Order is like a contract. It can only be amended, if all parties agree. 2- Movements in a delivery may exist on their own (ex. an accounting transaction). Past movements can not be modified. Future movements may or may not be modified When an order is confirmed, the list of "order" movements it contains is copied into "delivery" movements. Each delivery movement contains a "causality" reference to the order it. This allows delivery to be completely different from order (ex. different resource, different date, different quantity) and allows to keep track of the causal relation between a delivery and an order. A delivery document then points to one or more of the "delivery" movements in the simulation. It is possible to know which items have been delivered by making sure each movement in the simulation is associated to a "delivery document". By looking at all "simulation" Delivery movements can be applied the following transformations:
One should note that
Some submovements need no order to be "confirmed". Some submovements need an order to be "confirmed". For example
This means that the simulation process must make a distinction between different workflows applicable to a movement. For movements which require an order to be confirmed, the workflow involves the following steps:
As a result, a delivery movement which requires an order may have 2 causalities
Each causality may define its own context. One context may be related for example to a customer request, another context may be related to an "internal customer" request (eg. the production manager). Context may eventually conflict each other. In a customer oriented company, movements should probably always be stored within the customer order and acquire from the order all context information. In a mass production facility, context may be defined in more than one location. This is an incentive for putting all movements in a simulation "box". The second approach is chosen for documentary consistency approach : in ERP5, documents rules, can be synchronized. Simulation can not be synchronized Process PresentationSimulation Directory (S)Contains Applied Rules (A) which contain Simulation Movements (M) which contain applied rules.... Calculation rules
Deliveries (D)A container of Movements aggregated from the Simulation. User is allowed to change target_quantity, target_start_date and target_stop_date in the user interface. It has no consequence on the Simulation of values. Delivey isDivergent whenever target values and value are different. Delivery automatically changes its state to diverged. User may confirm that Delivery should adopt new target values (and that the simulation should adopt new values for quantity, start_date and stop_date). In this case, user may chose a DSolver (D as in Delivery) to distribute new quantity values accross Simulation Movement quantities. Simulation movements acquire new dates from the new start_date and stop_date of the Delivery, defined after the target values of the Delivery. The DSolver makes the Delivery consistent again. An ASolver (A as in applied rule) must then be applied to parent rules of movements related to the Delivery, so that new targets are defined based on the new quantities changed by the DSolver. This process is a bottom-up process (it eventually changes target values of parents, or adds movements to compensate inconsistency of an Applied Rule). During that process, new target values defined upwards may be inconsistent with values defined in deliveries. ASolver is responsible for updating target values of Deliveries (thus making such deliveries inconsistent) and to continue upward the update of target_values. The whole chain of applied rules will then be inconsistent with proposed new target of deliveries. Whenever an applied rule updated by a DSolver is consistent without requirement for an ASolver (or if ASolver makes it consistent ?), expansion can take place and forward new target values downwards. The expansion process works on targets and goes from top to down. During the expansion process, changes of target values may require to update more target values of Deliveries. ASolver vs. DSolverDSolver changes values in the Simulation. It implements in the Simulation decisions of Deliveries. It defines new values which represent the expected reality. ASolver changes targets in the Simulation. It defines new targets & movements which allow values and target values to match in the simulation. It either changes a target value (more, less, before, later) to meet a rule, or adds movements to compensate for unmet aspects of a rule. Expansion ProcessApplied rules expansion defines new targets:
During expansion, some movements may be divergent (ie. target and values differ if movement is associated to a delivery):
DSolve ProcessThe DSolve process defines new values at a given point of the simulation. (on movements) If a movement solved by DSolve is not divergent anymore, expansion takes place immediately after DSolve. Else, ASolve takes place immediately after. ASolve ProcessThe ASolve redefine new targets from bottom up.
ASolver has 2 different modes
Once the ASolve process is finished, an expansion process defines new targets downwards. Simulation Movements (M)Whenever target values and values are different, a movement is said to be divergent. Divergent movements must be solved. Movements not attached to a delivery movement never need to be solved. (ie. values acquire target values). Only movements related to a delivery may need to be solved. Solving movement may only happen in the DSolve process. Applied Rules (A)At any time, some applied rules may be divergent. It is the responsability of the rule to define the meaning of divergence of child movements. An order rule is divergent whenever target values and values differ in child movemements. A transformation rule is divergent whenever target values and values differ in child movement or when target quantities in child movements do not allow to produce the required target quantity in the parent movement. Solving divergent applied rules is implemented by showing a list of deliveries which movements relate to child movements of divergent applied rules. Presentation uses (if possible) trees which mimic the causality chain of the simulation. Solving applied rules require to define new targets. The choice is driven by the deliveries and a user choice of ASolver. It is mostly automated. Inconsistent DeliveriesSome target values in deliveries may be equal to current values of the delivery but inconsistent with target values in the simulation. This is another case of divergence. The simumlation process should automatically update target values of the delivery to new target values of the simulation. Either user adopts new target values in the Delivery (easy) or use forces back existing values. The latter case requires the use of a DSolver. What happens if...If the default_target_start_date is changed in a DeliveryA DeliverySolver instance may copy the new target_start_date to start_date of simulation movements related to the delivery. New start_date is propagated upwards by TargetSolver instance (for example, to postpone the whole production). New target is propagated downwards by expand (for example, to postpone delivery of sourced material) If the default_target_source is changed in a DeliveryA DeliverySolver instance may copy the new target_source to source of simulation movements related to the delivery. New target_source is propagated upwards by TargetSolver instance (for example, to change a production site in order to comply with new shipment site of goods required for production). New target is propagated downwards by expand (for example, to set all sourcing at the new production site) If the resource is changed in a Delivery MovementpropagateResourceToSimulation is activated on the delivery. If the variation range is changed in a Delivery MovementpropagateResourceToSimulation is activated on the delivery. If the target_source is changed in a Simulation MovementupdateFromSimulation is activated on the Delivery The Delivery may end up with multiple target sources. updateFromSimulation is constrained to execution after propagateResourceToSimulation. If the target_start_date is changed in a Simultation MovementupdateFromSimulation is activated on the Delivery The Delivery may end up with multiple target start dates. If the resource is changed in a Simulation MovementupdateFromSimulation is activated on the Delivery The Delivery may end up with more resource lines. Changes in the simulation are reflected through target quantities and quantities. If the variation is changed in a Simulation MovementupdateFromSimulation is activated on the Delivery The Delivery may end up with more resource lines. Changes in the simulation are reflected through target quantities and quantities. |
|
|