Reputation: 1
I am new to OPL and CPLEX. Whenever I try to run my configuration, consisting of simple .mod and .dat, it fails and shows an error ": multi-byte error, wrong encoding? .". I assumed that the problem is with my OPL project encoding, but switching to UTF-8 made 0 change. How can I fix that? The code is all in latin, so are the paths for the files the.dat file is as follows:
students = { Carwyn, Aidan, Lerato, Dinesh, Harun,Vasu, Bartolomeu, Frigyes, Minato, Helen,Maura, Bertha, Marcelin, Elmira, Vijay };
local = [0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1];
score = [75, 55, 34, 62, 52, 47, 85,78, 74, 61, 93, 89, 84, 29, 65];
ngroups = 5;
and the .mod is
{string} students = ...;
int local[students] = ...;
int score[students] = ...;
int ngroups = ...;
dvar boolean x[students][1..ngroups];
dvar float beta;
maximize beta;
subject to{
// three students per group
forall(i in 1..ngroups) sum(s in students) x[s][i] == 3;
// at most one group per student
forall(s in students) sum(i in 1..ngroups) x[s][i] == 1;
// one local per group
forall(i in 1..ngroups) sum(s in students) local[s]*x[s][i] >= 1;
// beta is the max-min of group scores
forall(i in 1..ngroups)
sum(s in students) score[s]*x[s][i] >= beta;
}
the names for both files are ses2
[File names][1]
[1]: https://i.sstatic.net/AzCgd.png
Upvotes: 0
Views: 298
Reputation: 10062
in documentation IDE and OPL > Starting Kit > Globalization
You may read
CPLEX Studio does not support:
•Multibyte names for decision variables, as the CPLEX log file can have unexpected behavior if they are used.
•Transcoding from one system to another.
Each operating system deals with its own character encoding, so the behavior of string related functions (for example, a string length) may vary from one machine to another. The same model executed on Windows and on Unix may produce different results. For example, the function of a string length could return different numbers if you do not ensure that the encodings match.
•Identifiers that contain non-ASCII characters.
For example, French accents are not allowed. OPL identifiers are restricted to the ASCII character set.
and I ran your model and got
beta = 196;
x = [[0 0 0 0 1]
[1 0 0 0 0]
[0 0 1 0 0]
[0 1 0 0 0]
[1 0 0 0 0]
[0 0 0 1 0]
[0 0 0 1 0]
[0 0 1 0 0]
[0 1 0 0 0]
[0 1 0 0 0]
[0 0 0 0 1]
[1 0 0 0 0]
[0 0 1 0 0]
[0 0 0 0 1]
[0 0 0 1 0]];
are you sure you do not have some Russian letters in the name of the run configuration or anywhere else ?
Upvotes: 0