CREE-VARCYCLE
Arguments: dom longueur [generic-function]
cree-varcycle dom longueur
[generic-function]
Defines a constraint problem (csp) with a list of longueur variables ranging over he domains dom, and the constraints have to be defined in the associated patch (double click on the icon to open it). This patch is an instance of patchforvarcycle. The variables are considered as a cycle, which means that the list restarts at the end.
The first output give the csp (instance of the asvarcycle)
The second output gives the current values of the variables (random if no resolution has been made).
See below the documentation of the classes as-varcycle and patchforvarcycle
[generic-function]
Defines a constraint problem (csp) with a list of longueur variables ranging over he domains dom, and the constraints have to be defined in the associated patch (double click on the icon to open it). This patch is an instance of patchforvarcycle. The variables are considered as a cycle, which means that the list restarts at the end.
The first output give the csp (instance of the asvarcycle)
The second output gives the current values of the variables (random if no resolution has been made).
See below the documentation of the classes as-varcycle and patchforvarcycle
Inputs :
dom : a list, representing the possible values for the variables
longueur : the number of variables
dom : a list, representing the possible values for the variables
longueur : the number of variables
Outputs:
the csp (instance of asvracycle)
the current values of the variables
the csp (instance of asvracycle)
the current values of the variables
as-varcycle
[class]
Class of the csp with variables placed in a list, considered as a cycle.
The slots of the class are :
valeurs (a list) : the list of current values of the variables
domaines (a list) : the domain (same for all variables)
erreurs (a list) : the list of errors for each variable with regard to the constraints
erreur-global (an integer) : the error of the whole configuration with regrd to the constraints, which is the sum of all erreurs
tabu : the list of the variables marked as tabu (during the resolution, useless if you don't care about the detail of the resolution process)
longueur (an integer) : the number of variables
contraintes : the constraints. In case the as-varcycle is defined from cree-varcycle they are generated from what is defined in the associated patch.
cont-glob : aggregation of all the constraints for the whole configuration
[class]
Class of the csp with variables placed in a list, considered as a cycle.
The slots of the class are :
valeurs (a list) : the list of current values of the variables
domaines (a list) : the domain (same for all variables)
erreurs (a list) : the list of errors for each variable with regard to the constraints
erreur-global (an integer) : the error of the whole configuration with regrd to the constraints, which is the sum of all erreurs
tabu : the list of the variables marked as tabu (during the resolution, useless if you don't care about the detail of the resolution process)
longueur (an integer) : the number of variables
contraintes : the constraints. In case the as-varcycle is defined from cree-varcycle they are generated from what is defined in the associated patch.
cont-glob : aggregation of all the constraints for the whole configuration
patchforvarcycle
[class]
These patches are opened when double clicking on the cree-varcycle boxes.
They are used to define the constraints of the associated csp, which is an instance of as-varcycle.
We make the assumption that the constraints are always defined in the same way for all the variables. So they state on any variable (input written i), and possibly the following ones, which you can make appear by clicking on the second button in the up-right corner.
Since the variables are in a cycle, the list of variables is considered to restart at its end.
The whole list of variables is represented by the liste icon.
The constraints have to be connected to the state output. If you want to add constraints, you can either use the andc primitive to combine them or state them seperately, for this you need to add outputs by clicking on the state button in the up-right corner.
[class]
These patches are opened when double clicking on the cree-varcycle boxes.
They are used to define the constraints of the associated csp, which is an instance of as-varcycle.
We make the assumption that the constraints are always defined in the same way for all the variables. So they state on any variable (input written i), and possibly the following ones, which you can make appear by clicking on the second button in the up-right corner.
Since the variables are in a cycle, the list of variables is considered to restart at its end.
The whole list of variables is represented by the liste icon.
The constraints have to be connected to the state output. If you want to add constraints, you can either use the andc primitive to combine them or state them seperately, for this you need to add outputs by clicking on the state button in the up-right corner.
There are several kinds of predefined inputs :
i : denotes any variable
i+1, i+2, i+3, etc : the variables that follow i
i : denotes any variable
i+1, i+2, i+3, etc : the variables that follow i
Output :
state : connect the constraints here
state : connect the constraints here