<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Dear Cristiano,<br>
<br>
You can define the objective function through an AMPL .mod file,
e.g.:<br>
<br>
# Start of mod file<br>
var x {1..2};<br>
<br>
minimize obj:<br>
cos(x[1]+x[2]+2)+log(x[1]);<br>
<br>
subject to cons0:<br>
-4<=x[1]<=4;<br>
subject to cons1:<br>
-1<=x[2]<=3;<br>
# End of mod file<br>
<br>
Minotaur normally reads the .mod filename through the input, i.e.:<br>
<br>
$ ./minotaur_exe problem_file<br>
<br>
and then (inside the code):<br>
<br>
problem =
iface.readInstance(options->findString("problem_file")->getValue());<br>
<br>
You can read another file (let's say "second_file") by:<br>
<br>
problem = iface.readInstance("second_file");<br>
<br>
You can have multiple problem instances in your code this way, i.e.
you can set minotaur to read more than one file and get multiple
functions in your code, although when I tried to have to ProblemPtr
type problems on my setup I was getting segfaults when assigning
memory (with setNativeDer).<br>
<br>
If you create the second problem as a RelaxationPtr though you can
have as many problem instances as you want, it works fine!<br>
<br>
Kind regards,<br>
Nikos<br>
<br>
<br>
<div class="moz-cite-prefix">On 10/11/14 13:15, Cristiano Arbex
Valle wrote:<br>
</div>
<blockquote
cite="mid:CAGK3KyuVzyb4Qrn0SZyLUckExKmZT-VL0sH=qQ-+eKeWvTd=pw@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<div dir="ltr">Hi Ashutosh / Minotaur team
<div><br>
</div>
<div>Is it possible to have in Minotaur an independently
user-defined objective function, which Minotaur would call
whenever it needs to compute the objective function?</div>
<div><br>
</div>
<div>Thank you and best regards, </div>
<div>
<div><br>
</div>
<div class="gmail_signature">
<div>--</div>
Cristiano Arbex Valle<br>
<div><br>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Minotaur mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Minotaur@lists.mcs.anl.gov">Minotaur@lists.mcs.anl.gov</a>
<a class="moz-txt-link-freetext" href="https://lists.mcs.anl.gov/mailman/listinfo/minotaur">https://lists.mcs.anl.gov/mailman/listinfo/minotaur</a>
</pre>
</blockquote>
<br>
</body>
</html>