Hiya! I’m completely new to AIMMS so apologies if this is a really fundamental thing to ask.
I’ve been working on a model that I would like to call from within Python using AimmsCmd - for now while I’m just trying to get it to work, my code in Python linking to AIMMS is pretty much identical to the script in the guide to running batch commands:
aimmsPath = "C:\\Users\\44750\\AppData\\Local\\AIMMS\\IFA\\Aimms\\4.77.4.5-x64-VS2017\\Bin\\AimmsCmd.exe"
command = aimmsPath + " solver.aimms < cmds.txt > log.txt"
solve = subprocess.call(command, shell=True)
log = open("log.txt","r")
print(log.read())
log.close()
When I execute it however, I get this error:
Error: Unable to open AIMMS with "--as-server --ignore-dialogs --hidden "solver.aimms"": Starting up Aimms failed. Program initialization error.
Thinking it was probably my model or my code that was flagging up the error, I downloaded the StandAlone example from that same guide and copypasted the Python script - but it returned the exact same error. Does anyone have any idea how I could fix this?
Just in case it is my model after all, I’ll paste my cmds.txt file and model here too.
Model Main_solver {
Parameter s {
IndexDomain: (i,j);
Range: free;
}
Parameter t {
IndexDomain: i;
Range: free;
}
Parameter r {
IndexDomain: i;
Range: free;
}
Variable x {
IndexDomain: j;
Range: {
{0..2}
}
}
Variable y {
IndexDomain: i;
Range: {
{0..2}
}
}
Variable totalTiles {
Range: free;
Definition: sumb i, y(i) ];
}
Set setsJ {
Index: j;
Definition: {
{ 1 .. 1173 }
}
}
Set tilesI {
Index: i;
Definition: {
{ 1 .. 53 }
}
}
Constraint constraint1 {
IndexDomain: i;
Definition: sum j, s(i,j) * x(j) ] = t(i) + y(i);
}
Constraint constraint2 {
IndexDomain: i;
Definition: y(i) <= r(i);
}
MathematicalProgram rummikubProblem {
Objective: totalTiles;
Direction: maximize;
Constraints: AllConstraints;
Variables: AllVariables;
Type: Automatic;
}
Many thanks in advance!