Defines | Functions | Variables

StochModelComp.cpp File Reference

#include "StochModelComp.h"
#include "misc.h"
#include "nodes.h"
#include "sml.tab.h"
#include <cassert>
#include <cstdlib>
#include <iostream>

Defines

#define STRICT_ERROR_FOR_EXP_INSIDE_OBJECTIVE   1
 For objectives inside a stochastic block the expectation is implied, so we report an error if we use it explicitly.

Functions

static SyntaxNodebuildPathProbTerm (int level, const AmplModel *thisam, const StochModel *thissm, SyntaxNode *up)
 Multiply the current expression by the conditional probability terms.

Variables

static bool prtSM = false

Define Documentation

#define STRICT_ERROR_FOR_EXP_INSIDE_OBJECTIVE   1

For objectives inside a stochastic block the expectation is implied, so we report an error if we use it explicitly.


Function Documentation

static SyntaxNode* buildPathProbTerm ( int  level,
const AmplModel thisam,
const StochModel thissm,
SyntaxNode up 
) [static]

Multiply the current expression by the conditional probability terms.

This builds a tree of OpNodes that represents the multiplication of the current expression by the conditional probability terms to obtain the path probability.

Parameters:
level Level within the stochastic program block
thisam AmplModel needed to get the list of dummy variables used until here
thissm StochModel needed to get the name of the conditional probabilities parameter
up Current expression to be multiplied by the probabilities

References SyntaxNodeIx::getListDummyVars(), StochModel::getProbs(), ModelComp::indexing, AmplModel::node, AmplModel::parent, and SyntaxNodeIDREF::ref.

Referenced by StochModelComp::transcribeToModelComp().


Variable Documentation

bool prtSM = false [static]