Skip to content

Commit

Permalink
Updated expectedMasterModel.txt
Browse files Browse the repository at this point in the history
Updated testutil
  • Loading branch information
SimplisticCode committed Dec 14, 2023
1 parent 5072746 commit 11880b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
name = generatedFromMultiModel\nscenario = {\nfmus = {\nFMU_roller = { \n can-reject-step = true,\n inputs = {\nvalve = {reactivity=delayed}},\n outputs = {\nlevel = {dependencies-init=[valve], dependencies=[valve]}}\n }\nController_cont = { \n can-reject-step = true,\n inputs = {\nlevel = {reactivity=delayed}},\n outputs = {\n}\n }}\nconnections = [\n"FMU_roller.level" -> "Controller_cont.level"]\n}\ninitialization = [\n\n{set: "FMU_roller.valve"}\n\n{get: "FMU_roller.level"}\n\n{set: "Controller_cont.level"}\n\n\n]\ncosim-step = {conf1 = [{save-state: Controller_cont}\n\n{save-state: FMU_roller}\n\n{loop: { \n until-step-accept: [Controller_cont,FMU_roller] \n iterate: [{step: Controller_cont }\n\n{step: FMU_roller }\n] \n if-retry-needed: [{restore-state: Controller_cont}\n\n{restore-state: FMU_roller}\n]} \n }\n\n{set: "FMU_roller.valve"}\n\n{get: "FMU_roller.level"}\n\n{set: "Controller_cont.level"}\n]\n}
name = generatedFromMultiModel\nscenario = {\n \n fmus = {\n FMU_roller = \n {\n can-reject-step = true,\n inputs = {\n \n },\n outputs = {\n level = {dependencies-init=[], dependencies=[]}\n }\n }\nController_cont = \n {\n can-reject-step = true,\n inputs = {\n level = {reactivity=delayed}\n },\n outputs = {\n \n }\n }\n }\n connections = [ \"FMU_roller.level\" -> \"Controller_cont.level\"]\n\n}\ninitialization = [ {get: \"FMU_roller.level\"}\n {set: \"Controller_cont.level\"}]\ncosim-step = { conf1 =\n [ {save-state: Controller_cont}\n {save-state: FMU_roller}\n {\n loop: {\n until-step-accept: [Controller_cont,FMU_roller]\n iterate: [ {step: Controller_cont }\n {step: FMU_roller }]\n if-retry-needed: [ {restore-state: Controller_cont}, {restore-state: FMU_roller}]\n }\n }\n \n {get: \"FMU_roller.level\"}\n {set: \"Controller_cont.level\"}]\n }\n
13 changes: 6 additions & 7 deletions external_tester/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,19 @@ def compareCSV(expected, actual):
print(f"ERROR: {expected} doest not exist!")
return False

def comparText(file1, file):
def comparText(file1, file2):
expectedFile = open(file1, 'r')
actualFile = open(file, 'r')

actualFile = open(file2, 'r')
remove = str.maketrans('', '', string.whitespace)
expectedLines = expectedFile.readlines()
actualLines = actualFile.readlines()
print("Expected lines:" + str(expectedLines))
print("Actual lines:" + str(actualLines))
expectedLines = "".join(expectedLines).translate(remove)
actualLines = "".join(actualLines).translate(remove)

expectedFile.close()
actualFile.close()

remove = string.whitespace
return expectedLines.translate(None, remove) == actualLines.translate(None, remove)
return expectedLines == actualLines

def compare(strPrefix, expected, actual):
if os.path.exists(expected):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,6 @@ class MasterModelMapper {
maxPossibleStepSize
)

print("Hello from multiModelToMasterModel!")
print("Scenario model: ${scenarioModel.toConf(0)}")

// Generate the master model from the scenario
return GenerationAPI.synthesizeAlgorithm("generatedFromMultiModel", scenarioModel)
}
Expand Down

0 comments on commit 11880b2

Please sign in to comment.