Sample asset inspection index formulas

Inspection index formulas use the oAsset object to set the value of a variable called IndexRating. For more information and for sample code, click the Information tab in the Formula Editor.

For Defects Measured by Percentage:

This formula calculates an index for block cracking in a street segment. The formula is based on the severity and measurement of the block cracking (BLOCK) observation, which is measured as a percentage. The formula uses a slightly different calculation for each of three severities. "X" in each calculation is the measurement of the BLOCK defect:

  • For LOW severity, the index = 0.0006X2 - 0.125X + 10
  • For MED severity, the index = 0.0005X2 - 0.139X + 10
  • For HIGH severity, the index = 0.0009X2 - 0.19X + 10

Note that this formula will only use the first BLOCK observation found in an inspection. to calculate an index based on multiple observations of the same type, a more complex formula would be required.


dim oInsp as Hansen.AssetManagement.Street.ISEGServiceInspection
dim TempRating as System.Double = 10
 
for each oInsp in oAsset.ServiceInspections
if inspkey = oInsp.PrimaryKey then

 dim inspObs as 
       Hansen.AssetManagement.Street.ISEGServiceInspectionObservation
 for each inspObs in oInsp.Observations
 if inspObs.ObservationDefinition.ObservationCode = "BLOCK" then

  dim Measurement as System.Double
  Measurement = inspObs.Measurement
  if Measurement = 0 then 
   TempRating = 10
   Exit For
  else if inspObs.ObservationSeverity.ObservationSeverity = "LOW" then
   TempRating = (0.0006 * Measurement * Measurement) 
              - (.125 * Measurement) + 10
   Exit For
  else if inspObs.ObservationSeverity.ObservationSeverity = "MED" then
   TempRating = (0.0005 * Measurement * Measurement) 
              - (.139 * Measurement) + 10
   Exit For
  else if inspObs.ObservationSeverity.ObservationSeverity = "HIGH" then
   TempRating = (0.0009 * Measurement * Measurement) 
              - (.19 * Measurement) + 10
   Exit For
  end if

 end if

 If TempRating < 10 then
  Exit For
 end if 
 next

end if

If TempRating < 10 then
 Exit For
end if
next
 
IndexRating = TempRating

For Defects Measured by Count:

This formula calculates an index for transverse cracking in a street segment. The formula is based on the severity and measurement of the transverse cracking (TRANS) observation. The formula uses a slightly different calculation for each of three severities. "X" in each calculation is the measurement of the TRANS defect:

  • For LOW severity, the index = 9 - X
  • For MED severity, the index = 7 - X
  • For HIGH severity, the index = 5 - X

dim oInsp as Hansen.AssetManagement.Street.ISEGServiceInspection
dim TempRating as System.Double = 10
 
for each oInsp in oAsset.ServiceInspections
if inspkey = oInsp.PrimaryKey then
 
 dim inspObs as 
       Hansen.AssetManagement.Street.ISEGServiceInspectionObservation
 for each inspObs in oInsp.Observations
 
 if inspObs.ObservationDefinition.ObservationCode = "TRANS" then
 
  dim Measurement as System.Double
  Measurement = inspObs.Measurement
  if Measurement = 0 then 
   TempRating = 10
   Exit For
  else if inspObs.ObservationSeverity.ObservationSeverity = "LOW" then
   TempRating = 9 - Measurement 
   Exit For
  else if inspObs.ObservationSeverity.ObservationSeverity = "MED" then
   TempRating = 7 - Measurement
   Exit For
  else if inspObs.ObservationSeverity.ObservationSeverity = "HIGH" then
   TempRating = 5 - Measurement
   Exit For
  end if
 
 end if
 
 If TempRating < 10 then
  Exit For
 end if 
 next
 
end if
 
If TempRating < 10 then
 Exit For
end if
next
 
IndexRating = TempRating