Monte-Carlo Simulation
Monte-Carlo simulation example provides a more real-life application that calculates a risk value for a portfolio of loans. The point of this example is to provide a more real-life situation and demonstrate how it can be grid-enabled using GridGain. This example uses AOP-based grid enabling.
You can find this example at ${GRIDGAIN_HOME}/examples/src folder in package org.gridgain.examples.montecarlo.basic. Source code is fully Javadoc-ed and you can find the examples' Javadoc at ${GRIDGAIN_HOME}/examples/javadoc folder.
Package:
org.gridgain.examples.montecarlo.basic
| Class | Description |
|---|---|
| Credit.java | This class provides a simple model for a credit contract (or a loan). It is basically defines as remaining crediting amount to date, credit remaining term, APR and annual probability on default. Although this model is simplified for the purpose of this example, it is close enough to emulate the real-life credit risk assessment application. |
| CreditRiskExample.java | This is main class in this example. It basically starts grid locally (local node) and executes credit risk calculation. If there are grid nodes available this calculation will be gridified to other nodes. Information below describes how to configure JVM parameters to enable AOP-based grid enabling. |
| CreditRiskGridTask.java | This class represents all the logic necessary for split and aggregate grid enabling of credit risk calculation. There are two methods in this class responsible for splitting method invocation into multiple sub-calls and aggregating results back from splits. |
| CreditRiskManager.java | This class abstracts out the calculation of risk for a credit portfolio. This class abstracts out the calculation of risk for a credit portfolio. It contains calculateCreditRiskMonteCarlo(...) method annotated with @Gridify(...) annotation which means that execution will be split across multiple nodes. |
