Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
2

Query runner whether just-executed measure was applicable?

asked 2016-02-13 12:32:57 -0500

Measures don't return whether they are applicable or not (the return value is reserved for successful completion/error) instead applicability is registered with the runner. Can I query the runner to see whether the just executed measure was applicable? I cannot find the documentation for this.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-02-13 13:38:11 -0500

Try this:

  measure.run(model, runner, argument_map)
  result = runner.result

  puts "**MEASURE APPLICABILITY**"
  applicability = result.value.value
  if applicability ==  -1
    puts "#{applicability} = Not Applicable"
  elsif applicability == 0 
    puts "#{applicability} = Success"
  elsif applicability == 1 
    puts "#{applicability} = Fail"
  end

Here is the API documentation for the Runner

Here is the API documentation for the Runner Result

There are more examples of getting stuff (info, warning, error, initial/final condition) in this file.

edit flag offensive delete link more

Comments

Bingo! Thank you.

__AmirRoth__'s avatar __AmirRoth__  ( 2016-02-13 14:29:39 -0500 )edit

The OpenStudio SDK documentation site could be improved. Not in terms of content, but more in terms of indexing and searchability. Most searches come up empty. For instance, I searched for registerAsNotApplicable. Nothing. I will also make this comment on UV.

__AmirRoth__'s avatar __AmirRoth__  ( 2016-02-13 15:45:18 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Careers

Question Tools

2 followers

Stats

Asked: 2016-02-13 12:32:57 -0500

Seen: 137 times

Last updated: Feb 13 '16