LatentStateDynamicsContainer.java

  1. package org.drip.exposure.evolver;

  2. /*
  3.  * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  4.  */

  5. /*!
  6.  * Copyright (C) 2020 Lakshmi Krishnamurthy
  7.  * Copyright (C) 2019 Lakshmi Krishnamurthy
  8.  * Copyright (C) 2018 Lakshmi Krishnamurthy
  9.  *
  10.  *  This file is part of DROP, an open-source library targeting analytics/risk, transaction cost analytics,
  11.  *      asset liability management analytics, capital, exposure, and margin analytics, valuation adjustment
  12.  *      analytics, and portfolio construction analytics within and across fixed income, credit, commodity,
  13.  *      equity, FX, and structured products. It also includes auxiliary libraries for algorithm support,
  14.  *      numerical analysis, numerical optimization, spline builder, model validation, statistical learning,
  15.  *      and computational support.
  16.  *  
  17.  *      https://lakshmidrip.github.io/DROP/
  18.  *  
  19.  *  DROP is composed of three modules:
  20.  *  
  21.  *  - DROP Product Core - https://lakshmidrip.github.io/DROP-Product-Core/
  22.  *  - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/
  23.  *  - DROP Computational Core - https://lakshmidrip.github.io/DROP-Computational-Core/
  24.  *
  25.  *  DROP Product Core implements libraries for the following:
  26.  *  - Fixed Income Analytics
  27.  *  - Loan Analytics
  28.  *  - Transaction Cost Analytics
  29.  *
  30.  *  DROP Portfolio Core implements libraries for the following:
  31.  *  - Asset Allocation Analytics
  32.  *  - Asset Liability Management Analytics
  33.  *  - Capital Estimation Analytics
  34.  *  - Exposure Analytics
  35.  *  - Margin Analytics
  36.  *  - XVA Analytics
  37.  *
  38.  *  DROP Computational Core implements libraries for the following:
  39.  *  - Algorithm Support
  40.  *  - Computation Support
  41.  *  - Function Analysis
  42.  *  - Model Validation
  43.  *  - Numerical Analysis
  44.  *  - Numerical Optimizer
  45.  *  - Spline Builder
  46.  *  - Statistical Learning
  47.  *
  48.  *  Documentation for DROP is Spread Over:
  49.  *
  50.  *  - Main                     => https://lakshmidrip.github.io/DROP/
  51.  *  - Wiki                     => https://github.com/lakshmiDRIP/DROP/wiki
  52.  *  - GitHub                   => https://github.com/lakshmiDRIP/DROP
  53.  *  - Repo Layout Taxonomy     => https://github.com/lakshmiDRIP/DROP/blob/master/Taxonomy.md
  54.  *  - Javadoc                  => https://lakshmidrip.github.io/DROP/Javadoc/index.html
  55.  *  - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal
  56.  *  - Release Versions         => https://lakshmidrip.github.io/DROP/version.html
  57.  *  - Community Credits        => https://lakshmidrip.github.io/DROP/credits.html
  58.  *  - Issues Catalog           => https://github.com/lakshmiDRIP/DROP/issues
  59.  *  - JUnit                    => https://lakshmidrip.github.io/DROP/junit/index.html
  60.  *  - Jacoco                   => https://lakshmidrip.github.io/DROP/jacoco/index.html
  61.  *
  62.  *  Licensed under the Apache License, Version 2.0 (the "License");
  63.  *      you may not use this file except in compliance with the License.
  64.  *  
  65.  *  You may obtain a copy of the License at
  66.  *      http://www.apache.org/licenses/LICENSE-2.0
  67.  *  
  68.  *  Unless required by applicable law or agreed to in writing, software
  69.  *      distributed under the License is distributed on an "AS IS" BASIS,
  70.  *      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  71.  *  
  72.  *  See the License for the specific language governing permissions and
  73.  *      limitations under the License.
  74.  */

  75. /**
  76.  * <i>LatentStateDynamicsContainer</i> holds the Latent State Labels for a variety of Latent States and their
  77.  * Evolvers.  The References are:
  78.  *  
  79.  * <br><br>
  80.  *      <ul>
  81.  *          <li>
  82.  *              Burgard, C., and M. Kjaer (2013): Funding Costs, Funding Strategies <i>Risk</i> <b>23
  83.  *                  (12)</b> 82-87
  84.  *          </li>
  85.  *          <li>
  86.  *              Burgard, C., and M. Kjaer (2014): In the Balance <i>Risk</i> <b>24 (11)</b> 72-75
  87.  *          </li>
  88.  *          <li>
  89.  *              Burgard, C., and M. Kjaer (2014): PDE Representations of Derivatives with Bilateral Counter-
  90.  *                  party Risk and Funding Costs <i>Journal of Credit Risk</i> <b>7 (3)</b> 1-19
  91.  *          </li>
  92.  *          <li>
  93.  *              Gregory, J. (2009): Being Two-faced over Counter-party Credit Risk <i>Risk</i> <b>20 (2)</b>
  94.  *                  86-90
  95.  *          </li>
  96.  *          <li>
  97.  *              Piterbarg, V. (2010): Funding Beyond Discounting: Collateral Agreements and Derivatives
  98.  *                  Pricing <i>Risk</i> <b>21 (2)</b> 97-102
  99.  *          </li>
  100.  *          <li>
  101.  *      </ul>
  102.  *
  103.  *  <br><br>
  104.  *  <ul>
  105.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/PortfolioCore.md">Portfolio Core Module</a></li>
  106.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ExposureAnalyticsLibrary.md">Exposure Analytics</a></li>
  107.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/exposure/README.md">Exposure Group Level Collateralized/Uncollateralized Exposure</a></li>
  108.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/exposure/evolver/README.md">Securities and Exposure States Evolvers</a></li>
  109.  *  </ul>
  110.  *  
  111.  * @author Lakshmi Krishnamurthy
  112.  */

  113. public class LatentStateDynamicsContainer
  114. {
  115.     private java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> _fxEvolver = null;
  116.     private java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> _csaEvolver = null;
  117.     private java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> _repoEvolver = null;
  118.     private java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> _customEvolver = null;
  119.     private java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> _govvieEvolver = null;
  120.     private java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> _ratingEvolver = null;
  121.     private java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> _forwardEvolver = null;
  122.     private java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> _fundingEvolver = null;
  123.     private java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> _payDownEvolver = null;
  124.     private java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> _overnightEvolver =
  125.         null;
  126.     private java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> _collateralEvolver =
  127.         null;
  128.     private java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> _volatilityEvolver =
  129.         null;
  130.     private java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> _otcFixFloatEvolver =
  131.         null;
  132.     private java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> _entityCreditEvolver =
  133.         null;
  134.     private java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> _entityEquityEvolver =
  135.         null;
  136.     private java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> _entityHazardEvolver =
  137.         null;
  138.     private java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> _entityFundingEvolver =
  139.         null;
  140.     private java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> _entityRecoveryEvolver
  141.         = null;

  142.     /**
  143.      * Empty LatentStateDynamicsContainer Constructor
  144.      */

  145.     public LatentStateDynamicsContainer()
  146.     {
  147.         _fxEvolver = new
  148.             org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.exposure.evolver.TerminalLatentState>();

  149.         _csaEvolver = new
  150.             org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.exposure.evolver.TerminalLatentState>();

  151.         _repoEvolver = new
  152.             org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.exposure.evolver.TerminalLatentState>();

  153.         _customEvolver = new
  154.             org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.exposure.evolver.TerminalLatentState>();

  155.         _govvieEvolver = new
  156.             org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.exposure.evolver.TerminalLatentState>();

  157.         _ratingEvolver = new
  158.             org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.exposure.evolver.TerminalLatentState>();

  159.         _forwardEvolver = new
  160.             org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.exposure.evolver.TerminalLatentState>();

  161.         _fundingEvolver = new
  162.             org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.exposure.evolver.TerminalLatentState>();

  163.         _payDownEvolver = new
  164.             org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.exposure.evolver.TerminalLatentState>();

  165.         _overnightEvolver = new
  166.             org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.exposure.evolver.TerminalLatentState>();

  167.         _collateralEvolver = new
  168.             org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.exposure.evolver.TerminalLatentState>();

  169.         _volatilityEvolver = new
  170.             org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.exposure.evolver.TerminalLatentState>();

  171.         _otcFixFloatEvolver = new
  172.             org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.exposure.evolver.TerminalLatentState>();

  173.         _entityCreditEvolver = new
  174.             org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.exposure.evolver.TerminalLatentState>();

  175.         _entityEquityEvolver = new
  176.             org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.exposure.evolver.TerminalLatentState>();

  177.         _entityHazardEvolver = new
  178.             org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.exposure.evolver.TerminalLatentState>();

  179.         _entityFundingEvolver = new
  180.             org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.exposure.evolver.TerminalLatentState>();

  181.         _entityRecoveryEvolver = new
  182.             org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.exposure.evolver.TerminalLatentState>();
  183.     }

  184.     /**
  185.      * Retrieve the Equity Evolver Map
  186.      *
  187.      * @return The Equity Evolver Map
  188.      */

  189.     public java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> entityEquityMap()
  190.     {
  191.         return _entityEquityEvolver;
  192.     }

  193.     /**
  194.      * Add the Entity Equity Latent State Evolver
  195.      *
  196.      * @param terminalLatentState The Equity Entity Terminal Latent State
  197.      *
  198.      * @return TRUE - The Entity Equity Latent Successfully added
  199.      */

  200.     public boolean addEntityEquity (
  201.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  202.     {
  203.         if (null == terminalLatentState)
  204.         {
  205.             return false;
  206.         }

  207.         _entityEquityEvolver.put (
  208.             terminalLatentState.label().fullyQualifiedName(),
  209.             terminalLatentState
  210.         );

  211.         return true;
  212.     }

  213.     /**
  214.      * Indicate if the Entity Equity Latent State Exists
  215.      *
  216.      * @param entityEquityLabel The Entity Equity Latent State Label
  217.      *
  218.      * @return TRUE - The Entity Equity Latent State Exists
  219.      */

  220.     public boolean entityEquityExists (
  221.         final org.drip.state.identifier.EntityEquityLabel entityEquityLabel)
  222.     {
  223.         return null == entityEquityLabel ? false : _entityEquityEvolver.containsKey
  224.             (entityEquityLabel.fullyQualifiedName());
  225.     }

  226.     /**
  227.      * Retrieve the Entity Equity Latent State
  228.      *
  229.      * @param entityEquityLabel The Entity Equity Latent State Label
  230.      *
  231.      * @return The Entity Equity Latent State
  232.      */

  233.     public org.drip.exposure.evolver.TerminalLatentState entityEquity (
  234.         final org.drip.state.identifier.EntityEquityLabel entityEquityLabel)
  235.     {
  236.         return entityEquityExists (entityEquityLabel) ? _entityEquityEvolver.get
  237.             (entityEquityLabel.fullyQualifiedName()) : null;
  238.     }

  239.     /**
  240.      * Retrieve the Funding Evolver Map
  241.      *
  242.      * @return The Funding Evolver Map
  243.      */

  244.     public java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> fundingMap()
  245.     {
  246.         return _fundingEvolver;
  247.     }

  248.     /**
  249.      * Add the Funding Latent State Evolver
  250.      *
  251.      * @param terminalLatentState The Funding Terminal Latent State
  252.      *
  253.      * @return TRUE - The Funding Latent State Successfully added
  254.      */

  255.     public boolean addFunding (
  256.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  257.     {
  258.         if (null == terminalLatentState)
  259.         {
  260.             return false;
  261.         }

  262.         _fundingEvolver.put (
  263.             terminalLatentState.label().fullyQualifiedName(),
  264.             terminalLatentState
  265.         );

  266.         return true;
  267.     }

  268.     /**
  269.      * Indicate if the Funding Latent State Exists
  270.      *
  271.      * @param fundingLabel The Funding Latent State Label
  272.      *
  273.      * @return TRUE - The Funding Latent State Exists
  274.      */

  275.     public boolean fundingExists (
  276.         final org.drip.state.identifier.FundingLabel fundingLabel)
  277.     {
  278.         return null == fundingLabel ? false : _fundingEvolver.containsKey
  279.             (fundingLabel.fullyQualifiedName());
  280.     }

  281.     /**
  282.      * Retrieve the Funding Latent State
  283.      *
  284.      * @param fundingLabel The Funding Latent State Label
  285.      *
  286.      * @return The Funding Latent State
  287.      */

  288.     public org.drip.exposure.evolver.TerminalLatentState funding (
  289.         final org.drip.state.identifier.FundingLabel fundingLabel)
  290.     {
  291.         return fundingExists (fundingLabel) ? _fundingEvolver.get (fundingLabel.fullyQualifiedName()) : null;
  292.     }

  293.     /**
  294.      * Retrieve the Govvie Evolver Map
  295.      *
  296.      * @return The Govvie Evolver Map
  297.      */

  298.     public java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> govvieMap()
  299.     {
  300.         return _govvieEvolver;
  301.     }

  302.     /**
  303.      * Add the Govvie Latent State Evolver
  304.      *
  305.      * @param terminalLatentState The Govvie Terminal Latent State
  306.      *
  307.      * @return TRUE - The Govvie Latent State Successfully added
  308.      */

  309.     public boolean addGovvie (
  310.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  311.     {
  312.         if (null == terminalLatentState)
  313.         {
  314.             return false;
  315.         }

  316.         _govvieEvolver.put (
  317.             terminalLatentState.label().fullyQualifiedName(),
  318.             terminalLatentState
  319.         );

  320.         return true;
  321.     }

  322.     /**
  323.      * Indicate if the Govvie Latent State Exists
  324.      *
  325.      * @param govvieLabel The Govvie Latent State Label
  326.      *
  327.      * @return TRUE - The Govvie Latent State Exists
  328.      */

  329.     public boolean govvieExists (
  330.         final org.drip.state.identifier.GovvieLabel govvieLabel)
  331.     {
  332.         return null == govvieLabel ? false : _govvieEvolver.containsKey (govvieLabel.fullyQualifiedName());
  333.     }

  334.     /**
  335.      * Retrieve the Govvie Latent State
  336.      *
  337.      * @param govvieLabel The Govvie Latent State Label
  338.      *
  339.      * @return The Govvie Latent State
  340.      */

  341.     public org.drip.exposure.evolver.TerminalLatentState govvie (
  342.         final org.drip.state.identifier.GovvieLabel govvieLabel)
  343.     {
  344.         return govvieExists (govvieLabel) ? _govvieEvolver.get (govvieLabel.fullyQualifiedName()) : null;
  345.     }

  346.     /**
  347.      * Retrieve the FX Evolver Map
  348.      *
  349.      * @return The FX Evolver Map
  350.      */

  351.     public java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> fxMap()
  352.     {
  353.         return _fxEvolver;
  354.     }

  355.     /**
  356.      * Add the FX Latent State Evolver
  357.      *
  358.      * @param terminalLatentState The FX Terminal Latent State
  359.      *
  360.      * @return TRUE - The FX Latent State Successfully added
  361.      */

  362.     public boolean addFX (
  363.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  364.     {
  365.         if (null == terminalLatentState)
  366.         {
  367.             return false;
  368.         }

  369.         _fxEvolver.put (
  370.             terminalLatentState.label().fullyQualifiedName(),
  371.             terminalLatentState
  372.         );

  373.         return true;
  374.     }

  375.     /**
  376.      * Indicate if the FX Latent State Exists
  377.      *
  378.      * @param fxLabel The FX Latent State Label
  379.      *
  380.      * @return TRUE - The FX Latent State Exists
  381.      */

  382.     public boolean fxExists (
  383.         final org.drip.state.identifier.FXLabel fxLabel)
  384.     {
  385.         return null == fxLabel ? false : _fxEvolver.containsKey (fxLabel.fullyQualifiedName());
  386.     }

  387.     /**
  388.      * Retrieve the FX Latent State
  389.      *
  390.      * @param fxLabel The FX Latent State Label
  391.      *
  392.      * @return The FX Latent State
  393.      */

  394.     public org.drip.exposure.evolver.TerminalLatentState fx (
  395.         final org.drip.state.identifier.FXLabel fxLabel)
  396.     {
  397.         return fxExists (fxLabel) ? _fxEvolver.get (fxLabel.fullyQualifiedName()) : null;
  398.     }

  399.     /**
  400.      * Retrieve the Forward Evolver Map
  401.      *
  402.      * @return The Forward Evolver Map
  403.      */

  404.     public java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> forwardMap()
  405.     {
  406.         return _forwardEvolver;
  407.     }

  408.     /**
  409.      * Add the Forward Latent State Evolver
  410.      *
  411.      * @param terminalLatentState The Forward Terminal Latent State
  412.      *
  413.      * @return TRUE - The Forward Latent State Successfully added
  414.      */

  415.     public boolean addForward (
  416.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  417.     {
  418.         if (null == terminalLatentState)
  419.         {
  420.             return false;
  421.         }

  422.         _forwardEvolver.put (
  423.             terminalLatentState.label().fullyQualifiedName(),
  424.             terminalLatentState
  425.         );

  426.         return true;
  427.     }

  428.     /**
  429.      * Indicate if the Forward Latent State Exists
  430.      *
  431.      * @param forwardLabel The Forward Latent State Label
  432.      *
  433.      * @return TRUE - The Forward Latent State Exists
  434.      */

  435.     public boolean forwardExists (
  436.         final org.drip.state.identifier.ForwardLabel forwardLabel)
  437.     {
  438.         return null == forwardLabel ? false : _forwardEvolver.containsKey
  439.             (forwardLabel.fullyQualifiedName());
  440.     }

  441.     /**
  442.      * Retrieve the Forward Latent State
  443.      *
  444.      * @param forwardLabel The Forward Latent State Label
  445.      *
  446.      * @return The Forward Latent State
  447.      */

  448.     public org.drip.exposure.evolver.TerminalLatentState forward (
  449.         final org.drip.state.identifier.ForwardLabel forwardLabel)
  450.     {
  451.         return forwardExists (forwardLabel) ? _forwardEvolver.get (forwardLabel.fullyQualifiedName()) : null;
  452.     }

  453.     /**
  454.      * Retrieve the OTC Fix Float Evolver Map
  455.      *
  456.      * @return The OTC Fix Float Evolver Map
  457.      */

  458.     public java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> otcFixFloatMap()
  459.     {
  460.         return _otcFixFloatEvolver;
  461.     }

  462.     /**
  463.      * Add the OTC Fix Float Latent State Evolver
  464.      *
  465.      * @param terminalLatentState The OTC Fix Float Terminal Latent State
  466.      *
  467.      * @return TRUE - The OTC Fix Float Latent State Successfully added
  468.      */

  469.     public boolean addOTCFixFloat (
  470.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  471.     {
  472.         if (null == terminalLatentState)
  473.         {
  474.             return false;
  475.         }

  476.         _otcFixFloatEvolver.put (
  477.             terminalLatentState.label().fullyQualifiedName(),
  478.             terminalLatentState
  479.         );

  480.         return true;
  481.     }

  482.     /**
  483.      * Indicate if the OTC Fix Float Latent State Exists
  484.      *
  485.      * @param otcFixFloatLabel The OTC Fix Float Latent State Label
  486.      *
  487.      * @return TRUE - The OTC Fix Float Latent State Exists
  488.      */

  489.     public boolean otcFixFloatExists (
  490.         final org.drip.state.identifier.OTCFixFloatLabel otcFixFloatLabel)
  491.     {
  492.         return null == otcFixFloatLabel ? false : _otcFixFloatEvolver.containsKey
  493.             (otcFixFloatLabel.fullyQualifiedName());
  494.     }

  495.     /**
  496.      * Retrieve the OTC Fix Float Latent State
  497.      *
  498.      * @param otcFixFloatLabel The OTC Fix Float Latent State Label
  499.      *
  500.      * @return The OTC Fix Float Latent State
  501.      */

  502.     public org.drip.exposure.evolver.TerminalLatentState otcFixFloat (
  503.         final org.drip.state.identifier.OTCFixFloatLabel otcFixFloatLabel)
  504.     {
  505.         return otcFixFloatExists (otcFixFloatLabel) ? _otcFixFloatEvolver.get
  506.             (otcFixFloatLabel.fullyQualifiedName()) : null;
  507.     }

  508.     /**
  509.      * Retrieve the Overnight Evolver Map
  510.      *
  511.      * @return The Overnight Evolver Map
  512.      */

  513.     public java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> overnightMap()
  514.     {
  515.         return _overnightEvolver;
  516.     }

  517.     /**
  518.      * Add the Overnight Latent State Evolver
  519.      *
  520.      * @param terminalLatentState The Overnight Terminal Latent State
  521.      *
  522.      * @return TRUE - The Overnight Latent State Successfully added
  523.      */

  524.     public boolean addOvernight (
  525.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  526.     {
  527.         if (null == terminalLatentState)
  528.         {
  529.             return false;
  530.         }

  531.         _overnightEvolver.put (
  532.             terminalLatentState.label().fullyQualifiedName(),
  533.             terminalLatentState
  534.         );

  535.         return true;
  536.     }

  537.     /**
  538.      * Indicate if the Overnight Latent State Exists
  539.      *
  540.      * @param overnightLabel The Overnight Latent State Label
  541.      *
  542.      * @return TRUE - The Overnight Latent State Exists
  543.      */

  544.     public boolean overnightExists (
  545.         final org.drip.state.identifier.OvernightLabel overnightLabel)
  546.     {
  547.         return null == overnightLabel ? false : _overnightEvolver.containsKey
  548.             (overnightLabel.fullyQualifiedName());
  549.     }

  550.     /**
  551.      * Retrieve the Overnight Latent State
  552.      *
  553.      * @param overnightLabel The Overnight Latent State Label
  554.      *
  555.      * @return The Overnight Latent State
  556.      */

  557.     public org.drip.exposure.evolver.TerminalLatentState overnight (
  558.         final org.drip.state.identifier.OvernightLabel overnightLabel)
  559.     {
  560.         return overnightExists (overnightLabel) ? _overnightEvolver.get (overnightLabel.fullyQualifiedName())
  561.             : null;
  562.     }

  563.     /**
  564.      * Retrieve the Collateral Evolver Map
  565.      *
  566.      * @return The Collateral Evolver Map
  567.      */

  568.     public java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> collateralMap()
  569.     {
  570.         return _collateralEvolver;
  571.     }

  572.     /**
  573.      * Add the Collateral Latent State Evolver
  574.      *
  575.      * @param terminalLatentState The Collateral Terminal Latent State
  576.      *
  577.      * @return TRUE - The Collateral Latent State Successfully added
  578.      */

  579.     public boolean addCollateral (
  580.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  581.     {
  582.         if (null == terminalLatentState)
  583.         {
  584.             return false;
  585.         }

  586.         _collateralEvolver.put (
  587.             terminalLatentState.label().fullyQualifiedName(),
  588.             terminalLatentState
  589.         );

  590.         return true;
  591.     }

  592.     /**
  593.      * Indicate if the Collateral Latent State Exists
  594.      *
  595.      * @param collateralLabel The Collateral Latent State Label
  596.      *
  597.      * @return TRUE - The Collateral Latent State Exists
  598.      */

  599.     public boolean collateralExists (
  600.         final org.drip.state.identifier.CollateralLabel collateralLabel)
  601.     {
  602.         return null == collateralLabel ? false : _collateralEvolver.containsKey
  603.             (collateralLabel.fullyQualifiedName());
  604.     }

  605.     /**
  606.      * Retrieve the Collateral Latent State
  607.      *
  608.      * @param collateralLabel The Collateral Latent State Label
  609.      *
  610.      * @return The Collateral Latent State
  611.      */

  612.     public org.drip.exposure.evolver.TerminalLatentState collateral (
  613.         final org.drip.state.identifier.CollateralLabel collateralLabel)
  614.     {
  615.         return collateralExists (collateralLabel) ? _collateralEvolver.get
  616.             (collateralLabel.fullyQualifiedName()) : null;
  617.     }

  618.     /**
  619.      * Retrieve the CSA Evolver Map
  620.      *
  621.      * @return The CSA Evolver Map
  622.      */

  623.     public java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> csaMap()
  624.     {
  625.         return _csaEvolver;
  626.     }

  627.     /**
  628.      * Add the CSA Latent State Evolver
  629.      *
  630.      * @param terminalLatentState The CSA Terminal Latent State
  631.      *
  632.      * @return TRUE - The CSA Latent State Successfully added
  633.      */

  634.     public boolean addCSA (
  635.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  636.     {
  637.         if (null == terminalLatentState)
  638.         {
  639.             return false;
  640.         }

  641.         _csaEvolver.put (
  642.             terminalLatentState.label().fullyQualifiedName(),
  643.             terminalLatentState
  644.         );

  645.         return true;
  646.     }

  647.     /**
  648.      * Indicate if the CSA Latent State Exists
  649.      *
  650.      * @param csaLabel The CSA Latent State Label
  651.      *
  652.      * @return TRUE - The CSA Latent State Exists
  653.      */

  654.     public boolean csaExists (
  655.         final org.drip.state.identifier.CSALabel csaLabel)
  656.     {
  657.         return null == csaLabel ? false : _csaEvolver.containsKey (csaLabel.fullyQualifiedName());
  658.     }

  659.     /**
  660.      * Retrieve the CSA Latent State
  661.      *
  662.      * @param csaLabel The CSA Latent State Label
  663.      *
  664.      * @return The CSA Latent State
  665.      */

  666.     public org.drip.exposure.evolver.TerminalLatentState csa (
  667.         final org.drip.state.identifier.CSALabel csaLabel)
  668.     {
  669.         return csaExists (csaLabel) ? _csaEvolver.get (csaLabel.fullyQualifiedName()) : null;
  670.     }

  671.     /**
  672.      * Retrieve the Entity Hazard Evolver Map
  673.      *
  674.      * @return The Entity Hazard Evolver Map
  675.      */

  676.     public java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> entityHazardMap()
  677.     {
  678.         return _entityHazardEvolver;
  679.     }

  680.     /**
  681.      * Add the Entity Hazard Latent State Evolver
  682.      *
  683.      * @param terminalLatentState The Entity Hazard Terminal Latent State
  684.      *
  685.      * @return TRUE - The Entity Hazard Latent State Successfully added
  686.      */

  687.     public boolean addEntityHazard (
  688.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  689.     {
  690.         if (null == terminalLatentState)
  691.         {
  692.             return false;
  693.         }

  694.         _entityHazardEvolver.put (
  695.             terminalLatentState.label().fullyQualifiedName(),
  696.             terminalLatentState
  697.         );

  698.         return true;
  699.     }

  700.     /**
  701.      * Indicate if the Entity Hazard Latent State Exists
  702.      *
  703.      * @param entityHazardLabel The Entity Hazard Latent State Label
  704.      *
  705.      * @return TRUE - The Entity Hazard Latent State Exists
  706.      */

  707.     public boolean entityHazardExists (
  708.         final org.drip.state.identifier.EntityHazardLabel entityHazardLabel)
  709.     {
  710.         return null == entityHazardLabel ? false : _entityHazardEvolver.containsKey
  711.             (entityHazardLabel.fullyQualifiedName());
  712.     }

  713.     /**
  714.      * Retrieve the Entity Hazard Latent State
  715.      *
  716.      * @param entityHazardLabel The Entity Hazard Latent State Label
  717.      *
  718.      * @return The Entity Hazard Latent State
  719.      */

  720.     public org.drip.exposure.evolver.TerminalLatentState entityHazard (
  721.         final org.drip.state.identifier.EntityHazardLabel entityHazardLabel)
  722.     {
  723.         return entityHazardExists (entityHazardLabel) ? _entityHazardEvolver.get
  724.             (entityHazardLabel.fullyQualifiedName()) : null;
  725.     }

  726.     /**
  727.      * Retrieve the Entity Credit Evolver Map
  728.      *
  729.      * @return The Entity Credit Evolver Map
  730.      */

  731.     public java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> entityCreditMap()
  732.     {
  733.         return _entityCreditEvolver;
  734.     }

  735.     /**
  736.      * Add the Entity Credit Latent State Evolver
  737.      *
  738.      * @param terminalLatentState The Entity Credit Terminal Latent State
  739.      *
  740.      * @return TRUE - The Entity Credit Latent State Successfully added
  741.      */

  742.     public boolean addEntityCredit (
  743.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  744.     {
  745.         if (null == terminalLatentState)
  746.         {
  747.             return false;
  748.         }

  749.         _entityCreditEvolver.put (
  750.             terminalLatentState.label().fullyQualifiedName(),
  751.             terminalLatentState
  752.         );

  753.         return true;
  754.     }

  755.     /**
  756.      * Indicate if the Entity Credit Latent State Exists
  757.      *
  758.      * @param entityCreditLabel The Entity Credit Latent State Label
  759.      *
  760.      * @return TRUE - The Entity Credit Latent State Exists
  761.      */

  762.     public boolean entityCreditExists (
  763.         final org.drip.state.identifier.EntityCDSLabel entityCreditLabel)
  764.     {
  765.         return null == entityCreditLabel ? false : _entityCreditEvolver.containsKey
  766.             (entityCreditLabel.fullyQualifiedName());
  767.     }

  768.     /**
  769.      * Retrieve the Entity Credit Latent State
  770.      *
  771.      * @param entityCreditLabel The Entity Credit Latent State Label
  772.      *
  773.      * @return The Entity Credit Latent State
  774.      */

  775.     public org.drip.exposure.evolver.TerminalLatentState entityCredit (
  776.         final org.drip.state.identifier.EntityCDSLabel entityCreditLabel)
  777.     {
  778.         return entityCreditExists (entityCreditLabel) ? _entityCreditEvolver.get
  779.             (entityCreditLabel.fullyQualifiedName()) : null;
  780.     }

  781.     /**
  782.      * Retrieve the Entity Recovery Evolver Map
  783.      *
  784.      * @return The Entity Recovery Evolver Map
  785.      */

  786.     public java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> entityRecoveryMap()
  787.     {
  788.         return _entityRecoveryEvolver;
  789.     }

  790.     /**
  791.      * Add the Entity Recovery Latent State Evolver
  792.      *
  793.      * @param terminalLatentState The Entity Recovery Terminal Latent State
  794.      *
  795.      * @return TRUE - The Entity Recovery Latent State Successfully added
  796.      */

  797.     public boolean addEntityRecovery (
  798.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  799.     {
  800.         if (null == terminalLatentState)
  801.         {
  802.             return false;
  803.         }

  804.         _entityRecoveryEvolver.put (
  805.             terminalLatentState.label().fullyQualifiedName(),
  806.             terminalLatentState
  807.         );

  808.         return true;
  809.     }

  810.     /**
  811.      * Indicate if the Entity Recovery Latent State Exists
  812.      *
  813.      * @param entityRecoveryLabel The Entity Recovery Latent State Label
  814.      *
  815.      * @return TRUE - The Entity Recovery Latent State Exists
  816.      */

  817.     public boolean entityRecoveryExists (
  818.         final org.drip.state.identifier.EntityRecoveryLabel entityRecoveryLabel)
  819.     {
  820.         return null == entityRecoveryLabel ? false : _entityRecoveryEvolver.containsKey
  821.             (entityRecoveryLabel.fullyQualifiedName());
  822.     }

  823.     /**
  824.      * Retrieve the Entity Recovery Latent State
  825.      *
  826.      * @param entityRecoveryLabel The Entity Recovery Latent State Label
  827.      *
  828.      * @return The Entity Recovery Latent State
  829.      */

  830.     public org.drip.exposure.evolver.TerminalLatentState entityRecovery (
  831.         final org.drip.state.identifier.EntityRecoveryLabel entityRecoveryLabel)
  832.     {
  833.         return entityRecoveryExists (entityRecoveryLabel) ? _entityRecoveryEvolver.get
  834.             (entityRecoveryLabel.fullyQualifiedName()) : null;
  835.     }

  836.     /**
  837.      * Retrieve the Entity Funding Evolver Map
  838.      *
  839.      * @return The Entity Funding Evolver Map
  840.      */

  841.     public java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> entityFundingMap()
  842.     {
  843.         return _entityFundingEvolver;
  844.     }

  845.     /**
  846.      * Add the Entity Funding Latent State Evolver
  847.      *
  848.      * @param terminalLatentState The Entity Funding Terminal Latent State
  849.      *
  850.      * @return TRUE - The Entity Funding Latent State Successfully added
  851.      */

  852.     public boolean addEntityFunding (
  853.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  854.     {
  855.         if (null == terminalLatentState)
  856.         {
  857.             return false;
  858.         }

  859.         _entityFundingEvolver.put (
  860.             terminalLatentState.label().fullyQualifiedName(),
  861.             terminalLatentState
  862.         );

  863.         return true;
  864.     }

  865.     /**
  866.      * Indicate if the Entity Funding Latent State Exists
  867.      *
  868.      * @param entityFundingLabel The Entity Funding Latent State Label
  869.      *
  870.      * @return TRUE - The Entity Funding Latent State Exists
  871.      */

  872.     public boolean entityFundingExists (
  873.         final org.drip.state.identifier.EntityFundingLabel entityFundingLabel)
  874.     {
  875.         return null == entityFundingLabel ? false : _entityFundingEvolver.containsKey
  876.             (entityFundingLabel.fullyQualifiedName());
  877.     }

  878.     /**
  879.      * Retrieve the Entity Funding Latent State
  880.      *
  881.      * @param entityFundingLabel The Entity Funding Latent State Label
  882.      *
  883.      * @return The Entity Funding Latent State
  884.      */

  885.     public org.drip.exposure.evolver.TerminalLatentState entityFunding (
  886.         final org.drip.state.identifier.EntityFundingLabel entityFundingLabel)
  887.     {
  888.         return entityFundingExists (entityFundingLabel) ? _entityFundingEvolver.get
  889.             (entityFundingLabel.fullyQualifiedName()) : null;
  890.     }

  891.     /**
  892.      * Retrieve the Volatility Evolver Map
  893.      *
  894.      * @return The Volatility Evolver Map
  895.      */

  896.     public java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> volatilityMap()
  897.     {
  898.         return _volatilityEvolver;
  899.     }

  900.     /**
  901.      * Add the Volatility Latent State Evolver
  902.      *
  903.      * @param terminalLatentState The Volatility Terminal Latent State
  904.      *
  905.      * @return TRUE - The Volatility Latent State Successfully added
  906.      */

  907.     public boolean addVolatility (
  908.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  909.     {
  910.         if (null == terminalLatentState)
  911.         {
  912.             return false;
  913.         }

  914.         _volatilityEvolver.put (
  915.             terminalLatentState.label().fullyQualifiedName(),
  916.             terminalLatentState
  917.         );

  918.         return true;
  919.     }

  920.     /**
  921.      * Indicate if the Volatility Latent State Exists
  922.      *
  923.      * @param volatilityLabel The Volatility Latent State Label
  924.      *
  925.      * @return TRUE - The Volatility Latent State Exists
  926.      */

  927.     public boolean volatilityExists (
  928.         final org.drip.state.identifier.VolatilityLabel volatilityLabel)
  929.     {
  930.         return null == volatilityLabel ? false : _volatilityEvolver.containsKey
  931.             (volatilityLabel.fullyQualifiedName());
  932.     }

  933.     /**
  934.      * Retrieve the Volatility Latent State
  935.      *
  936.      * @param volatilityLabel The Volatility Latent State Label
  937.      *
  938.      * @return The Volatility Latent State
  939.      */

  940.     public org.drip.exposure.evolver.TerminalLatentState volatility (
  941.         final org.drip.state.identifier.VolatilityLabel volatilityLabel)
  942.     {
  943.         return volatilityExists (volatilityLabel) ? _volatilityEvolver.get
  944.             (volatilityLabel.fullyQualifiedName()) : null;
  945.     }

  946.     /**
  947.      * Retrieve the Ratings Evolver Map
  948.      *
  949.      * @return The Ratings Evolver Map
  950.      */

  951.     public java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> ratingMap()
  952.     {
  953.         return _ratingEvolver;
  954.     }

  955.     /**
  956.      * Add the Rating Latent State Evolver
  957.      *
  958.      * @param terminalLatentState The Rating Terminal Latent State
  959.      *
  960.      * @return TRUE - The Rating Latent State Successfully added
  961.      */

  962.     public boolean addRating (
  963.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  964.     {
  965.         if (null == terminalLatentState)
  966.         {
  967.             return false;
  968.         }

  969.         _ratingEvolver.put (
  970.             terminalLatentState.label().fullyQualifiedName(),
  971.             terminalLatentState
  972.         );

  973.         return true;
  974.     }

  975.     /**
  976.      * Indicate if the Rating Latent State Exists
  977.      *
  978.      * @param ratingLabel The Rating Latent State Label
  979.      *
  980.      * @return TRUE - The Rating Latent State Exists
  981.      */

  982.     public boolean ratingExists (
  983.         final org.drip.state.identifier.RatingLabel ratingLabel)
  984.     {
  985.         return null == ratingLabel ? false : _ratingEvolver.containsKey (ratingLabel.fullyQualifiedName());
  986.     }

  987.     /**
  988.      * Retrieve the Rating Latent State
  989.      *
  990.      * @param ratingLabel The Rating Latent State Label
  991.      *
  992.      * @return The Rating Latent State
  993.      */

  994.     public org.drip.exposure.evolver.TerminalLatentState rating (
  995.         final org.drip.state.identifier.RatingLabel ratingLabel)
  996.     {
  997.         return ratingExists (ratingLabel) ? _ratingEvolver.get (ratingLabel.fullyQualifiedName()) : null;
  998.     }

  999.     /**
  1000.      * Retrieve the Repo Evolver Map
  1001.      *
  1002.      * @return The Repo Evolver Map
  1003.      */

  1004.     public java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> repoMap()
  1005.     {
  1006.         return _repoEvolver;
  1007.     }

  1008.     /**
  1009.      * Add the Repo Latent State Evolver
  1010.      *
  1011.      * @param terminalLatentState The Repo Terminal Latent State
  1012.      *
  1013.      * @return TRUE - The Repo Latent State Successfully added
  1014.      */

  1015.     public boolean addRepo (
  1016.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  1017.     {
  1018.         if (null == terminalLatentState)
  1019.         {
  1020.             return false;
  1021.         }

  1022.         _repoEvolver.put (
  1023.             terminalLatentState.label().fullyQualifiedName(),
  1024.             terminalLatentState
  1025.         );

  1026.         return true;
  1027.     }

  1028.     /**
  1029.      * Indicate if the Repo Latent State Exists
  1030.      *
  1031.      * @param repoLabel The Repo Latent State Label
  1032.      *
  1033.      * @return TRUE - The Repo Latent State Exists
  1034.      */

  1035.     public boolean repoExists (
  1036.         final org.drip.state.identifier.RepoLabel repoLabel)
  1037.     {
  1038.         return null == repoLabel ? false : _repoEvolver.containsKey (repoLabel.fullyQualifiedName());
  1039.     }

  1040.     /**
  1041.      * Retrieve the Repo Latent State
  1042.      *
  1043.      * @param repoLabel The Repo Latent State Label
  1044.      *
  1045.      * @return The Repo Latent State
  1046.      */

  1047.     public org.drip.exposure.evolver.TerminalLatentState repo (
  1048.         final org.drip.state.identifier.RepoLabel repoLabel)
  1049.     {
  1050.         return repoExists (repoLabel) ? _repoEvolver.get (repoLabel.fullyQualifiedName()) : null;
  1051.     }

  1052.     /**
  1053.      * Retrieve the Pay Down Evolver Map
  1054.      *
  1055.      * @return The Pay Down Evolver Map
  1056.      */

  1057.     public java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> payDownMap()
  1058.     {
  1059.         return _payDownEvolver;
  1060.     }

  1061.     /**
  1062.      * Add the Pay Down Latent State Evolver
  1063.      *
  1064.      * @param terminalLatentState The Pay Down Terminal Latent State
  1065.      *
  1066.      * @return TRUE - The Repo Latent State Successfully added
  1067.      */

  1068.     public boolean addPayDown (
  1069.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  1070.     {
  1071.         if (null == terminalLatentState)
  1072.         {
  1073.             return false;
  1074.         }

  1075.         _payDownEvolver.put (
  1076.             terminalLatentState.label().fullyQualifiedName(),
  1077.             terminalLatentState
  1078.         );

  1079.         return true;
  1080.     }

  1081.     /**
  1082.      * Indicate if the Pay Down Latent State Exists
  1083.      *
  1084.      * @param payDownLabel The Pay Down Latent State Label
  1085.      *
  1086.      * @return TRUE - The Pay Down Latent State Exists
  1087.      */

  1088.     public boolean payDownExists (
  1089.         final org.drip.state.identifier.PaydownLabel payDownLabel)
  1090.     {
  1091.         return null == payDownLabel ? false : _payDownEvolver.containsKey
  1092.             (payDownLabel.fullyQualifiedName());
  1093.     }

  1094.     /**
  1095.      * Retrieve the Pay Down Latent State
  1096.      *
  1097.      * @param payDownLabel The Pay Down Latent State Label
  1098.      *
  1099.      * @return The Pay Down Latent State
  1100.      */

  1101.     public org.drip.exposure.evolver.TerminalLatentState payDown (
  1102.         final org.drip.state.identifier.PaydownLabel payDownLabel)
  1103.     {
  1104.         return payDownExists (payDownLabel) ? _payDownEvolver.get (payDownLabel.fullyQualifiedName()) : null;
  1105.     }

  1106.     /**
  1107.      * Retrieve the Custom Evolver Map
  1108.      *
  1109.      * @return The Custom Evolver Map
  1110.      */

  1111.     public java.util.Map<java.lang.String, org.drip.exposure.evolver.TerminalLatentState> customMap()
  1112.     {
  1113.         return _customEvolver;
  1114.     }

  1115.     /**
  1116.      * Add the Custom Latent State Evolver
  1117.      *
  1118.      * @param terminalLatentState The Custom Terminal Latent State
  1119.      *
  1120.      * @return TRUE - The Custom Latent State Successfully added
  1121.      */

  1122.     public boolean addCustom (
  1123.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  1124.     {
  1125.         if (null == terminalLatentState)
  1126.         {
  1127.             return false;
  1128.         }

  1129.         _customEvolver.put (
  1130.             terminalLatentState.label().fullyQualifiedName(),
  1131.             terminalLatentState
  1132.         );

  1133.         return true;
  1134.     }

  1135.     /**
  1136.      * Indicate if the Custom Latent State Exists
  1137.      *
  1138.      * @param customLabel The Custom Latent State Label
  1139.      *
  1140.      * @return TRUE - The Custom Latent State Exists
  1141.      */

  1142.     public boolean customExists (
  1143.         final org.drip.state.identifier.CustomLabel customLabel)
  1144.     {
  1145.         return null == customLabel ? false : _customEvolver.containsKey (customLabel.fullyQualifiedName());
  1146.     }

  1147.     /**
  1148.      * Retrieve the Custom Latent State
  1149.      *
  1150.      * @param customLabel The Custom Latent State Label
  1151.      *
  1152.      * @return The Custom Latent State
  1153.      */

  1154.     public org.drip.exposure.evolver.TerminalLatentState custom (
  1155.         final org.drip.state.identifier.CustomLabel customLabel)
  1156.     {
  1157.         return customExists (customLabel) ? _customEvolver.get (customLabel.fullyQualifiedName()) : null;
  1158.     }

  1159.     /**
  1160.      * Add the Terminal Latent State
  1161.      *
  1162.      * @param terminalLatentState The Terminal Latent State
  1163.      *
  1164.      * @return TRUE - The Terminal Latent State Successfully added
  1165.      */

  1166.     public boolean addTerminalLatentState (
  1167.         final org.drip.exposure.evolver.TerminalLatentState terminalLatentState)
  1168.     {
  1169.         if (null == terminalLatentState)
  1170.         {
  1171.             return false;
  1172.         }

  1173.         org.drip.state.identifier.LatentStateLabel label = terminalLatentState.label();

  1174.         if (label instanceof org.drip.state.identifier.EntityEquityLabel)
  1175.         {
  1176.             return addEntityEquity (terminalLatentState);
  1177.         }

  1178.         if (label instanceof org.drip.state.identifier.FundingLabel)
  1179.         {
  1180.             return addFunding (terminalLatentState);
  1181.         }

  1182.         if (label instanceof org.drip.state.identifier.GovvieLabel)
  1183.         {
  1184.             return addGovvie (terminalLatentState);
  1185.         }

  1186.         if (label instanceof org.drip.state.identifier.FXLabel)
  1187.         {
  1188.             return addFX (terminalLatentState);
  1189.         }

  1190.         if (label instanceof org.drip.state.identifier.ForwardLabel)
  1191.         {
  1192.             return addForward (terminalLatentState);
  1193.         }

  1194.         if (label instanceof org.drip.state.identifier.OTCFixFloatLabel)
  1195.         {
  1196.             return addOTCFixFloat (terminalLatentState);
  1197.         }

  1198.         if (label instanceof org.drip.state.identifier.OvernightLabel)
  1199.         {
  1200.             return addOvernight (terminalLatentState);
  1201.         }

  1202.         if (label instanceof org.drip.state.identifier.CollateralLabel)
  1203.         {
  1204.             return addCollateral (terminalLatentState);
  1205.         }

  1206.         if (label instanceof org.drip.state.identifier.CSALabel)
  1207.         {
  1208.             return addCSA (terminalLatentState);
  1209.         }

  1210.         if (label instanceof org.drip.state.identifier.EntityHazardLabel)
  1211.         {
  1212.             return addEntityHazard (terminalLatentState);
  1213.         }

  1214.         if (label instanceof org.drip.state.identifier.EntityRecoveryLabel)
  1215.         {
  1216.             return addEntityRecovery (terminalLatentState);
  1217.         }

  1218.         if (label instanceof org.drip.state.identifier.EntityFundingLabel)
  1219.         {
  1220.             return addEntityFunding (terminalLatentState);
  1221.         }

  1222.         if (label instanceof org.drip.state.identifier.EntityCDSLabel)
  1223.         {
  1224.             return addEntityCredit (terminalLatentState);
  1225.         }

  1226.         if (label instanceof org.drip.state.identifier.VolatilityLabel)
  1227.         {
  1228.             return addVolatility (terminalLatentState);
  1229.         }

  1230.         if (label instanceof org.drip.state.identifier.RatingLabel)
  1231.         {
  1232.             return addRating (terminalLatentState);
  1233.         }

  1234.         if (label instanceof org.drip.state.identifier.RepoLabel)
  1235.         {
  1236.             return addRepo (terminalLatentState);
  1237.         }

  1238.         if (label instanceof org.drip.state.identifier.PaydownLabel)
  1239.         {
  1240.             return addPayDown (terminalLatentState);
  1241.         }

  1242.         if (label instanceof org.drip.state.identifier.CustomLabel)
  1243.         {
  1244.             return addCustom (terminalLatentState);
  1245.         }

  1246.         return false;
  1247.     }

  1248.     /**
  1249.      * Indicate if the Label exists
  1250.      *
  1251.      * @param label The Latent State Label
  1252.      *
  1253.      * @return TRUE - The Latent State Label exists
  1254.      */

  1255.     public boolean labelExists (
  1256.         final org.drip.state.identifier.LatentStateLabel label)
  1257.     {
  1258.         if (null == label)
  1259.         {
  1260.             return false;
  1261.         }

  1262.         if (label instanceof org.drip.state.identifier.EntityEquityLabel)
  1263.         {
  1264.             return entityEquityExists ((org.drip.state.identifier.EntityEquityLabel) label);
  1265.         }

  1266.         if (label instanceof org.drip.state.identifier.FundingLabel)
  1267.         {
  1268.             return fundingExists ((org.drip.state.identifier.FundingLabel) label);
  1269.         }

  1270.         if (label instanceof org.drip.state.identifier.GovvieLabel)
  1271.         {
  1272.             return govvieExists ((org.drip.state.identifier.GovvieLabel) label);
  1273.         }

  1274.         if (label instanceof org.drip.state.identifier.FXLabel)
  1275.         {
  1276.             return fxExists((org.drip.state.identifier.FXLabel) label);
  1277.         }

  1278.         if (label instanceof org.drip.state.identifier.ForwardLabel)
  1279.         {
  1280.             return forwardExists ((org.drip.state.identifier.ForwardLabel) label);
  1281.         }

  1282.         if (label instanceof org.drip.state.identifier.OTCFixFloatLabel)
  1283.         {
  1284.             return otcFixFloatExists ((org.drip.state.identifier.OTCFixFloatLabel) label);
  1285.         }

  1286.         if (label instanceof org.drip.state.identifier.OvernightLabel)
  1287.         {
  1288.             return overnightExists ((org.drip.state.identifier.OvernightLabel) label);
  1289.         }

  1290.         if (label instanceof org.drip.state.identifier.CollateralLabel)
  1291.         {
  1292.             return collateralExists ((org.drip.state.identifier.CollateralLabel) label);
  1293.         }

  1294.         if (label instanceof org.drip.state.identifier.CSALabel)
  1295.         {
  1296.             return csaExists ((org.drip.state.identifier.CSALabel) label);
  1297.         }

  1298.         if (label instanceof org.drip.state.identifier.EntityHazardLabel)
  1299.         {
  1300.             return entityHazardExists ((org.drip.state.identifier.EntityHazardLabel) label);
  1301.         }

  1302.         if (label instanceof org.drip.state.identifier.EntityCDSLabel)
  1303.         {
  1304.             return entityCreditExists ((org.drip.state.identifier.EntityCDSLabel) label);
  1305.         }

  1306.         if (label instanceof org.drip.state.identifier.EntityRecoveryLabel)
  1307.         {
  1308.             return entityRecoveryExists ((org.drip.state.identifier.EntityRecoveryLabel) label);
  1309.         }

  1310.         if (label instanceof org.drip.state.identifier.EntityFundingLabel)
  1311.         {
  1312.             return entityFundingExists ((org.drip.state.identifier.EntityFundingLabel) label);
  1313.         }

  1314.         if (label instanceof org.drip.state.identifier.VolatilityLabel)
  1315.         {
  1316.             return volatilityExists ((org.drip.state.identifier.VolatilityLabel) label);
  1317.         }

  1318.         if (label instanceof org.drip.state.identifier.RatingLabel)
  1319.         {
  1320.             return ratingExists ((org.drip.state.identifier.RatingLabel) label);
  1321.         }

  1322.         if (label instanceof org.drip.state.identifier.RepoLabel)
  1323.         {
  1324.             return repoExists ((org.drip.state.identifier.RepoLabel) label);
  1325.         }

  1326.         if (label instanceof org.drip.state.identifier.PaydownLabel)
  1327.         {
  1328.             return payDownExists ((org.drip.state.identifier.PaydownLabel) label);
  1329.         }

  1330.         if (label instanceof org.drip.state.identifier.CustomLabel)
  1331.         {
  1332.             return customExists ((org.drip.state.identifier.CustomLabel) label);
  1333.         }

  1334.         return false;
  1335.     }

  1336.     /**
  1337.      * Retrieve the Terminal Latent State corresponding to the Label
  1338.      *
  1339.      * @param label The Latent State Label
  1340.      *
  1341.      * @return The Terminal Latent State corresponding to the Label
  1342.      */

  1343.     public org.drip.exposure.evolver.TerminalLatentState terminal (
  1344.         final org.drip.state.identifier.LatentStateLabel label)
  1345.     {
  1346.         if (null == label)
  1347.         {
  1348.             return null;
  1349.         }

  1350.         if (label instanceof org.drip.state.identifier.EntityEquityLabel &&
  1351.             entityEquityExists ((org.drip.state.identifier.EntityEquityLabel) label))
  1352.         {
  1353.             return _entityEquityEvolver.get (label.fullyQualifiedName());
  1354.         }

  1355.         if (label instanceof org.drip.state.identifier.FundingLabel &&
  1356.             fundingExists ((org.drip.state.identifier.FundingLabel) label))
  1357.         {
  1358.             return _fundingEvolver.get (label.fullyQualifiedName());
  1359.         }

  1360.         if (label instanceof org.drip.state.identifier.GovvieLabel &&
  1361.             govvieExists ((org.drip.state.identifier.GovvieLabel) label))
  1362.         {
  1363.             return _govvieEvolver.get (label.fullyQualifiedName());
  1364.         }

  1365.         if (label instanceof org.drip.state.identifier.FXLabel &&
  1366.             fxExists ((org.drip.state.identifier.FXLabel) label))
  1367.         {
  1368.             return _fxEvolver.get (label.fullyQualifiedName());
  1369.         }

  1370.         if (label instanceof org.drip.state.identifier.ForwardLabel &&
  1371.             forwardExists ((org.drip.state.identifier.ForwardLabel) label))
  1372.         {
  1373.             return _forwardEvolver.get (label.fullyQualifiedName());
  1374.         }

  1375.         if (label instanceof org.drip.state.identifier.OTCFixFloatLabel &&
  1376.             otcFixFloatExists ((org.drip.state.identifier.OTCFixFloatLabel) label))
  1377.         {
  1378.             return _otcFixFloatEvolver.get (label.fullyQualifiedName());
  1379.         }

  1380.         if (label instanceof org.drip.state.identifier.OvernightLabel &&
  1381.             overnightExists ((org.drip.state.identifier.OvernightLabel) label))
  1382.         {
  1383.             return _overnightEvolver.get (label.fullyQualifiedName());
  1384.         }

  1385.         if (label instanceof org.drip.state.identifier.CollateralLabel &&
  1386.             collateralExists ((org.drip.state.identifier.CollateralLabel) label))
  1387.         {
  1388.             return _collateralEvolver.get (label.fullyQualifiedName());
  1389.         }

  1390.         if (label instanceof org.drip.state.identifier.CSALabel &&
  1391.             csaExists ((org.drip.state.identifier.CSALabel) label))
  1392.         {
  1393.             return _csaEvolver.get (label.fullyQualifiedName());
  1394.         }

  1395.         if (label instanceof org.drip.state.identifier.EntityHazardLabel &&
  1396.             entityHazardExists ((org.drip.state.identifier.EntityHazardLabel) label))
  1397.         {
  1398.             return _entityHazardEvolver.get (label.fullyQualifiedName());
  1399.         }

  1400.         if (label instanceof org.drip.state.identifier.EntityCDSLabel &&
  1401.             entityCreditExists ((org.drip.state.identifier.EntityCDSLabel) label))
  1402.         {
  1403.             return _entityCreditEvolver.get (label.fullyQualifiedName());
  1404.         }

  1405.         if (label instanceof org.drip.state.identifier.EntityRecoveryLabel &&
  1406.             entityRecoveryExists ((org.drip.state.identifier.EntityRecoveryLabel) label))
  1407.         {
  1408.             return _entityRecoveryEvolver.get (label.fullyQualifiedName());
  1409.         }

  1410.         if (label instanceof org.drip.state.identifier.EntityFundingLabel &&
  1411.             entityFundingExists ((org.drip.state.identifier.EntityFundingLabel) label))
  1412.         {
  1413.             return _entityFundingEvolver.get (label.fullyQualifiedName());
  1414.         }

  1415.         if (label instanceof org.drip.state.identifier.VolatilityLabel &&
  1416.             volatilityExists ((org.drip.state.identifier.VolatilityLabel) label))
  1417.         {
  1418.             return _volatilityEvolver.get (label.fullyQualifiedName());
  1419.         }

  1420.         if (label instanceof org.drip.state.identifier.RatingLabel &&
  1421.             ratingExists ((org.drip.state.identifier.RatingLabel) label))
  1422.         {
  1423.             return _ratingEvolver.get (label.fullyQualifiedName());
  1424.         }

  1425.         if (label instanceof org.drip.state.identifier.RepoLabel &&
  1426.             repoExists ((org.drip.state.identifier.RepoLabel) label))
  1427.         {
  1428.             return _repoEvolver.get (label.fullyQualifiedName());
  1429.         }

  1430.         if (label instanceof org.drip.state.identifier.PaydownLabel &&
  1431.             payDownExists ((org.drip.state.identifier.PaydownLabel) label))
  1432.         {
  1433.             return _payDownEvolver.get (label.fullyQualifiedName());
  1434.         }

  1435.         if (label instanceof org.drip.state.identifier.CustomLabel &&
  1436.             customExists ((org.drip.state.identifier.CustomLabel) label))
  1437.         {
  1438.             return _customEvolver.get (label.fullyQualifiedName());
  1439.         }

  1440.         return null;
  1441.     }
  1442. }