Skip to content

Commit

Permalink
- added optimization variables to mapping
Browse files Browse the repository at this point in the history
- added some scripts to execute all simulations in the msl with special flags

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25805 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Marcus Walther committed Apr 29, 2015
1 parent 1a2bb57 commit 2f771a1
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Compiler/SimCode/SimCodeUtil.mo
Expand Up @@ -12503,14 +12503,18 @@ protected
list<SimCodeVar.SimVar> inputVars;
list<SimCodeVar.SimVar> outputVars;
list<SimCodeVar.SimVar> constVars;
//list<SimCodeVar.SimVar> jacobianVars;
list<SimCodeVar.SimVar> realOptimizeConstraintsVars;
list<SimCodeVar.SimVar> realOptimizeFinalConstraintsVars;
HashTableCrILst.HashTable varIndexMappingHashTable;
HashTableCrIListArray.HashTable varArrayIndexMappingHashTable;
tuple<Integer,Integer,Integer> currentVarIndices;
algorithm
oVarToArrayIndexMapping := match(iModelInfo)
case(SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(stateVars=stateVars,derivativeVars=derivativeVars,algVars=algVars,discreteAlgVars=discreteAlgVars,
intAlgVars=intAlgVars,boolAlgVars=boolAlgVars,aliasVars=aliasVars,intAliasVars=intAliasVars,boolAliasVars=boolAliasVars,paramVars=paramVars,
intParamVars=intParamVars,boolParamVars=boolParamVars,inputVars=inputVars,outputVars=outputVars, constVars=constVars)))
intParamVars=intParamVars,boolParamVars=boolParamVars,inputVars=inputVars,outputVars=outputVars, constVars=constVars,
realOptimizeConstraintsVars=realOptimizeConstraintsVars, realOptimizeFinalConstraintsVars=realOptimizeFinalConstraintsVars)))
equation
varArrayIndexMappingHashTable = HashTableCrIListArray.emptyHashTable();
varIndexMappingHashTable = HashTableCrILst.emptyHashTable();
Expand All @@ -12524,13 +12528,15 @@ algorithm
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(paramVars, function createVarToArrayIndexMapping1(iVarType=1), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(intParamVars, function createVarToArrayIndexMapping1(iVarType=2), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(boolParamVars, function createVarToArrayIndexMapping1(iVarType=3), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(inputVars, function createVarToArrayIndexMapping1(iVarType=1), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(outputVars, function createVarToArrayIndexMapping1(iVarType=1), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(constVars, function createVarToArrayIndexMapping1(iVarType=1), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(realOptimizeConstraintsVars, function createVarToArrayIndexMapping1(iVarType=1), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(realOptimizeFinalConstraintsVars, function createVarToArrayIndexMapping1(iVarType=1), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));

((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(aliasVars, function createVarToArrayIndexMapping1(iVarType=1), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(intAliasVars, function createVarToArrayIndexMapping1(iVarType=2), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(boolAliasVars, function createVarToArrayIndexMapping1(iVarType=3), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));

((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(inputVars, function createVarToArrayIndexMapping1(iVarType=1), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(outputVars, function createVarToArrayIndexMapping1(iVarType=1), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(constVars, function createVarToArrayIndexMapping1(iVarType=1), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
then varArrayIndexMappingHashTable;
else
then HashTableCrIListArray.emptyHashTable();
Expand Down

0 comments on commit 2f771a1

Please sign in to comment.