modify Julia output for mapping eqidx
parent
7d1a467aa3
commit
d668590ff8
|
@ -3163,6 +3163,7 @@ DynamicModel::writeOutput(ostream &output, const string &basename, bool block_de
|
||||||
equation_tags.writeOccbinOutput(output, modstruct, julia);
|
equation_tags.writeOccbinOutput(output, modstruct, julia);
|
||||||
|
|
||||||
// Write mapping for variables and equations they are present in
|
// Write mapping for variables and equations they are present in
|
||||||
|
if (!julia)
|
||||||
for (const auto &variable : variableMapping)
|
for (const auto &variable : variableMapping)
|
||||||
{
|
{
|
||||||
output << modstruct << "mapping." << symbol_table.getName(variable.first) << ".eqidx = [";
|
output << modstruct << "mapping." << symbol_table.getName(variable.first) << ".eqidx = [";
|
||||||
|
@ -3170,6 +3171,21 @@ DynamicModel::writeOutput(ostream &output, const string &basename, bool block_de
|
||||||
output << equation + 1 << " ";
|
output << equation + 1 << " ";
|
||||||
output << "];" << endl;
|
output << "];" << endl;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
output << modstruct << "mapping.eqidx = Dict(\n";
|
||||||
|
for (const auto &variable : variableMapping)
|
||||||
|
{
|
||||||
|
output << " \""
|
||||||
|
<< symbol_table.getName(variable.first)
|
||||||
|
<< "\" => [";
|
||||||
|
for (auto equation : variable.second)
|
||||||
|
output << equation + 1 << ", ";
|
||||||
|
output << "]," << endl;
|
||||||
|
}
|
||||||
|
output << ")" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Say if static and dynamic models differ (because of [static] and [dynamic]
|
/* Say if static and dynamic models differ (because of [static] and [dynamic]
|
||||||
equation tags) */
|
equation tags) */
|
||||||
|
|
Loading…
Reference in New Issue