Navigation: Scripting Reference Manual > Functions & Subroutines > EvaluateMeritFunction

 

EvaluateMeritFunction

 

Contact Us: fredsupport@photonengr.com

 

Description

This function evaluates the merit function value using one of three options for supplying and/or applying variable values.

 

Syntax

success = EvaluateMeritFunction( mf, evalType )

 

Parameters

success (Boolean)

Return value indicating whether the merit function evaluation was successful.

 

mf As Double

After the function executes, this variable contains the evaluated merit function value.

 

evalType As String

String specifying the merit function evaluation mode.  Refer to Help topic Optimize Commands for more information.  Options are:

Mode

String

Evaluate Once

"once"

Evaluate With Current Variable Set

"set"

Evaluate With Current and Reset

"restore"

 

 

Example

The following example demonstrates how to use the EvaluateMeritFunction command with the "once" mode option and print the result to the output window.

 

Sub Main

          

    Dim success As Boolean

    Dim MF As Double

    Dim evalType As String

    evalType = "once"

    success = EvaluateMeritFunction( MF, evalType )

 

    Print "Merit function evaluation: " & Chr(9) & success

    Print "Evaluation type: " & Chr(9) & evalType

    Print "MF value: " & Chr(9) & MF

 

End Sub

 

See Also

Optimization Script Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC