First time here? Check our help page!
2

Query runner whether just-executed measure was applicable?

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.

__AmirRoth__'s avatar
4.4k
__AmirRoth__
asked 2016-02-13 12:32:57 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

2

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.

aparker's avatar
8.2k
aparker
answered 2016-02-13 13:38:11 -0500
edit flag offensive 0 remove flag delete link

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
add a comment see more comments