User Tools

Site Tools


howtos:toolcoding:feedback_views

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
howtos:toolcoding:feedback_views [2011/06/21 15:47]
shona.weldon
howtos:toolcoding:feedback_views [2011/06/23 14:10]
chris.strashok
Line 1: Line 1:
 ====== Feedback views ====== ====== Feedback views ======
  
-Feed back views are a way to run part of the model in a loop adjusting model inputs for each iteration and providing back to the view the model outputs required.+Feed back views are a way to run part of the model in a loop adjusting model inputs for each iteration and providing back to the view of the model outputs required.  The reasons for using feedback views include handling model feedback links, and trying to get model outputs to track on some know data.  There are many other ways of using feed back too.
  
 There are a few built in tool variables that are available to the view writer to track the feedback process and terminate the loop when ready they are: There are a few built in tool variables that are available to the view writer to track the feedback process and terminate the loop when ready they are:
   * **$fbViewIteration** - the iteration number of the loop   * **$fbViewIteration** - the iteration number of the loop
-  * **$fbViewMaxIters** - the maximum number of iterations the user who starts the view requested +  * **$fbViewMaxIters** - the maximum number of iterations ​requested by the user 
-  * **$fbViewTolerance** - the convergence tolerance the user who starts the view requested+  * **$fbViewTolerance** - the convergence tolerance ​requested by the user
  
 You can declare regular **local** variables however be aware that they are wiped out at the start of each iteration. You can declare regular **local** variables however be aware that they are wiped out at the start of each iteration.
Line 20: Line 20:
  
  
-==== Declaring in views.samm ==== 
  
-Declare the feedback view in views.samm:​ +==== Example feedback view files ====
- +
-<​file>​ +
-fbview trackEU compare trackEU.v trackEU.t ​ "​Tracking Energy Use“ 20 0.001 +
-</​file>​ +
- +
-where the line contains the following parameters:​ +
- +
-type of view (fbview)\\ +
-view name\\ +
-model scope\\ +
-.v file name\\ +
-.t file name\\ +
-description\\ +
-default number of iterations \\ +
-convergence tolerance \\ +
- +
-==== Template/​Examples ​====+
  
 Here is an example of the .v and .t files for a simple feedback view that modifies a model input until the model output matches some given "​golden"​ value in the last time slice. Here is an example of the .v and .t files for a simple feedback view that modifies a model input until the model output matches some given "​golden"​ value in the last time slice.
Line 118: Line 100:
 endif endif
 </​file>​ </​file>​
 +
 +
 +==== Declaring in views.samm ====
 +
 +Declare the feedback view in views.samm:
 +
 +<​file>​
 +fbview trackEU compare trackEU.v trackEU.t ​ "​Tracking Energy Use“ 20 0.001
 +</​file>​
 +
 +where the line contains the following parameters:
 +
 +type of view (= fbview)\\
 +view name\\
 +model scope\\
 +.v file name\\
 +.t file name\\
 +description\\
 +default number of iterations \\
 +convergence tolerance \\
  
 ==== Object Array Size and Contents ==== ==== Object Array Size and Contents ====
howtos/toolcoding/feedback_views.txt · Last modified: 2017/04/14 16:32 by marcus.williams