Result models

From Heureka Wiki
Revision as of 11:52, 19 May 2010 by Fkl (talk | contribs)
Jump to navigation Jump to search

Implementing a Result Model

A result model is implemented as a class that is depending on:

  1. Treatment Unit
  2. Period (optional)
  3. Before or after treatment in the period (optional)
  4. Other results (optional)
  5. Treatments in the period (optional)

The class is given the attribute Slu.Heureka.DomainLayer.Forest.TreatmentUnitResult. In the attribute it is specified which of the above parameters that are required by the model.

The class must also have a constructor with the required parameters, in the same order as above. When a new instance of the class is created, the results of the model should be calculated.

All properties of the class will be exposed as result variables, unless the attribute Browsable is set to false.

Each property must be a simple type (nullable simple types are allowed), or a SpeciesCollection. Note that all simple types not have been used, so simple types other than int, double, bool, and int-based enums should be tested carefully.

On each property the DisplayName attribute and the Slu.Heureka.DomainLayer.Forest.Unit attribute may be given. The former is the name that will be presented to the user for the property, and the latter gives the user extra information about the unit of the attribute.

Once the model is implemented as above, the result variables will be available in maps, diagrams, tables, optimization models, and forest domains.

Getting results in code

The inner workings of the result class