New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No array3d for par opt int values #188

udalrich opened this Issue Nov 30, 2017 · 1 comment


None yet
3 participants

udalrich commented Nov 30, 2017

There exist array3d functions to create 3d arrays of var int, opt var int and par int but there is not a corresponding function to create a 3d array of par opt int. This makes it impossible to initialize such arrays.

My use case is that I have a job shop style program, where the jobs only require a subset of all tasks, and there are multiple combinations that will complete a job. To model this, I am creating an array as such

enum Tasks;
enum Jobs;
int: maxTasks;
set of int: TaskIndex = 1..maxTasks;
int maxOptions;
set of int: Options = 1..maxOptions;

array[Jobs, Options, TaskIndex] of Tasks: jobOptions;

I would like to initialize jobOptions by

jobOptions = array3d(Jobs, Options, TaskIndex, [
     % Job 1
     Task1, Task2, % Option 1
     Task3, <>,      % Option 2

      % Job 2
     Task3, Task2, % Option 1
     <>, <>,      % Only one option for job 2

but that fails because it returns an array of opt var Tasks. If I replace <> with fix(<>), then none of the existing functions match the parameter.


This comment has been minimized.


guidotack commented Dec 4, 2017

This has been fixed on the develop branch now, the fix will be part of an upcoming release.

@guidotack guidotack closed this in 0a1c9a7 Jan 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment