Skip to content

Adding Branch Channels ​

This appendix provides a ADS-specific coding instruction for adding a branching channel into the ADS simulation program. Currently, branches can be generated either by the Decision Maker, Action Taker, and Control panel. In the future the user might want to add Consultant or other means to generate branches, this appendix provides detail step-by-step instruction for adding such channels.

Step-by-Step Instruction:

  1. Create a class (e.g., class B_Task) for branching which should inherit the following classes
    1. Communication by which sender and receivers’ are specified
    2. TimerAndProbability by which the time required to activate this branch and the branch probability are specified. (This also can be done by including Timer and Probability separately)
    3. A class for representing the branch (e.g., class Task)
  2. Edit BranchUnit.h and .cpp files
    1. For BranchUnit.h
      1. Add #include “B_Task.h”
      2. Add vector<B_Task *> task
    2. For BranchUnit.cpp, edit the following routines to have B_Task included by following the pattern of the subroutine
      1. void BranchUnit::calculateNumberOfCombination()
      2. void BranchUnit::clearBranchUnit()
      3. void BranchUnit::clearBranchUnitAllPointers()
      4. int BranchUnit::getTotalPiecesOfInfo()
      5. void BranchUnit::copyBranchUnit(BranchUnit &_bu)
      6. int BranchUnit::getNumberOfItemInBranchUnit()
  3. Edit BranchProbability.h and .cpp files, edit the following routines to have B_Task included by following the pattern of the subroutine
    1. For BranchProbability.h
      1. Add #include “B_Task.h”
    2. For BranchProbability.cpp
      1. void BranchProbability::calculateProbability()
      2. void BranchProbability::sendBranchInfoToCommandCenter()
  4. Edit CommunicationPlace.h and .cpp if B_task is not an operator generated branch
    1. For CommunicationPlace.h
      1. Add #include “T_Task.h”
      2. Add Vector <T_Task *> Task
    2. ForCommunicationPlace.cpp
      1. Edit void CommunicationPlace::clearCommunicationPlaceAll()
      2. Edit void CommunicationPlace::updateSenderReceiverInfo() if T_Task is related to obtaining system information or intervening in the system state in contrast to mental process only
      3. void CommunicationPlace::copyCommunicationPlace() if T_Task is related to obtaining system information or intervening in the system state in contrast to mental process only
      4. void CommunicationPlace::saveInfoToFileAsBranchForADSV1() This reoutine generate the DET output files
      5. Edit int CommunicationPlace::getNumberOfItemInCommunicationPlace() if necessary
  5. Edit BranchRecord.h and .cpp files
    1. BranchRecord.h
      1. Add #include “B_Task.h”
    2. BranchRecord.cpp
      1. Add void BranchRecord::addB_Task() follow the same patter of other routines if the T_task is generated by crew
      2. Edit void BranchRecord::addB_Task(..) if the T_task is generated by crew
      3. Edit void BranchRecord::calculateTotalNumberOfBranch() if necessary
      4. Edit int BranchRecord::checkAndAddBranchCluster() If B_Task is not a human-oriented task
      5. Edit void BranchRecord::addCrewContentToExpandedBranch() if B_Task is a human-oriented task
      6. Edit void BranchRecord::addB_TaskToExpandedBranch () if B_task is not a human-oriented task
      7. Edit void BranchRecord::clearBranchRecordAll() if B_Task is not a human-oriented task
  6. Edit CommandControlUnit.h and .cpp
    1. CommandControlUnit.h
      1. Add #include “B_Task.h”
      2. Add B_Task *task
    2. CommandControlUnit.cpp
      1. In CommandControlUnit::CommandControlUnit() set task = 0;
      2. Edit void CommandControlUnit::copyCommandControlUnit() follows the same pattern
      3. Edit void CommandControlUnit::clear()
  7. Edit CommandControlCenter.h and.cpp
    1. CommandControlCenter.h
    2. CommandControlCenter.cpp
      1. Add void CommandControlCenter::addB_Task(B_Task *)
      2. Edit CommandControlCenter::sendInfoToCommunicationPlace() Notes: for both commands and commands_residual; The commands_residual also include memory removing part within (*commands_itr)->getStateOfActivation() == VSUCCEED
  8. Edit OperatrXX.h and .cpp
    1. OperatorXX.h
    2. OperatorXX.cpp
      1. Edit void OperatorXX::identifyRelevantInformation() for the rules for the operator to perceive or not perceive the information B_Task

Edit void OperatorXX::infoChunking() for the rules for the operator to process the incoming B_Task

ADS-IDAC Engine Documentation