VB.NET Tutorial Code 5: Computing Value of Information
From DSL
(Redirected from VB.NET Code: Tutorials: Tutorial 5: Computing Value of Information)
Public Sub ComputeValueOfInformation()
Try
Dim net As new Network()
net.ReadFile("tutorial_b.xdsl")
Dim voi As new ValueOfInfo(net)
' Setting up the VOI object:
voi.AddNode("Forecast")
voi.SetDecision("Invest")
voi.Update()
Dim results() As Double = voi.GetValues()
Dim EVIForecast As double = results(0)
Console.WriteLine("Expected Value of Information (""Forecast"") = " + EVIForecast.ToString())
Catch e As SmileException
Console.WriteLine(e.Message)
End Try
End Sub