Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
D
Data Processing
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
3
Issues
3
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
Container Registry
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ACS
P
Public
VILLASframework
Data Processing
Commits
280bb40d
Commit
280bb40d
authored
Jul 12, 2018
by
Bichen Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Add a simulate_modelica function for simulation the model
parent
45aa3db8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
examples/assertresults/assertresults.py
examples/assertresults/assertresults.py
+23
-0
No files found.
examples/assertresults/assertresults.py
View file @
280bb40d
...
...
@@ -3,10 +3,33 @@ import os
import
sys
sys
.
path
.
append
(
r"D:\HIWI\Git\data-processing\dataprocessing"
)
sys
.
path
.
append
(
r"D:\HIWI\Git\python-for-modelica-dev_interface\Py4Mod\py4mod"
)
from
ModelicaModel
import
ModelicaModel
from
validationtools
import
*
from
readtools
import
*
os
.
chdir
(
r"D:\HIWI\Git"
)
def
simulate_modelica
(
model_name
,
model_path
):
interface
=
ModelicaModel
(
model_name
,
model_path
)
# Initialization
interface
.
createInterface
(
"OPENMODELICA"
)
interface
.
loadFile
(
model_path
+
'
\
ModPowerSystems
\
package.mo'
)
# Redirection
cwd
=
os
.
getcwd
()
wd
=
os
.
path
.
join
(
cwd
,
'test'
)
if
not
os
.
path
.
exists
(
wd
):
os
.
makedirs
(
wd
)
interface
.
changeWorkingDirectory
(
wd
.
replace
(
"
\\
"
,
"/"
))
# Build & Run
interface
.
buildModel
()
interface
.
simulate
()
print
(
"Test Start"
)
# We need to extract all the result files from git now
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment