Download WEAP User Guide
Transcript
Advanced Topics
xls.Cells(r, 3).Value =
V.Expression
END IF
NEXT
NEXT
BranchExists(BranchName): Check if a branch IF WEAP.BranchExists("\Demand
Sites\South City") THEN
exists. Read only.
WEAP.Branch("\Demand Sites\South
City").Variables("Consumption").Expres
sion = "30"
END IF
BranchVariable(BranchName:VariableName): WEAP.BranchVariable("\Demand
Sites\South
Get the WEAPVariable object for the specified
City:Consumption").Expression =
branch and variable. VariableName can be
"30"
omitted if BranchName only has one variable
(e.g., Key Assumptions branches have one
Note:
This
is
equivalent
variable). Note: This is equivalent to
Branch(BranchName).Variable(VariableName)
Branch(BranchName).Variables(VariableName).
Read only.
to
WEAP.Calculate
Calculate(LastYear, LastTimestep,
AlwaysCalculate): Force WEAP to calculate all WEAP.Calculate(2000, 6)
scenarios marked for calculation, even if WEAP
WEAP.Calculate(0, 0, false)
' Only
thinks the calculations are up to date (unless
calculate scenarios that need
optional parameter AlwaysCalculate is set to
calculation
false). This is useful if you have changed values
in an input file that WEAP is reading via
ReadFromFile. If optional parameters LastYear
and LastTime are given, only calculate up to that
year and timestep. Note: AlwaysCalculate =
false is the same as calling WEAP.View =
"Results," because that also only calculates
scenarios needing calculation.
CalculationErrors: Get the number of WEAP
calculation errors from the just-run WEAP
calculation. Read only.
IF WEAP.CalculationErrors > 0 THEN
PRINT WEAP.CalculationErrors, "
calculation errors"
CalculationTime: Get the calculation time from PRINT WEAP.CalculationTime, " seconds
to calculate"
the just-run WEAP calculation, in seconds. Read
only.
CalcTS: Get the timestep being calculated.
Read only.
IF WEAP.CalcYear = WEAP.BaseYear and
WEAP.CalcTS = WEAP.NumTimeSteps
THEN
' Do something in the last timestep
of the Current Accounts
311