/*****************************************************************************
 * File: EXP_dom_init.c
 *
 * Initialization services for the following domain:
 * Domain:     EXP
 * Repository: exp.ooa
 *
 * Notice:
 *   (C) Copyright 1999, 2000 ROX Software, Inc.
 *   All rights reserved.
 *
 * Model Compiler:  MC3020 V1.3.0
 *
 * Warnings:
 *   !!! THIS IS AN AUTO-GENERATED FILE. PLEASE DO NOT EDIT. !!!
 ****************************************************************************/


#include "EXP_objects.h"
#include "EXP_T_events.h"
#include "A_FBO_bridge.h"
#include "EXP_dom_init.h"

#include "EXP_T_object.h"


/*****************************************************************************
 * Initialization Object: experiment init  (INIT)
 *
 * State [1]: 'INIT'
 ****************************************************************************/
void
EXP_INIT_InitState_1()
{
  EXP_T_s * v1;  /* t */

  /* CREATE OBJECT INSTANCE t OF T */
  v1 = EXP_T_Create();

  /* ASSIGN t.start = 0 */
  v1->m_start = 0;

  /* ASSIGN t.end = 60 */
  v1->m_end = 60;

  /* ASSIGN t.number_of_batches = 2 */
  v1->m_number_of_batches = 2;

  /* ASSIGN t.current_batch = 0 */
  v1->m_current_batch = 0;

  /* BRIDGE A::INIT() */
  A_FBO_INIT();

  /* GENERATE T1:'go'() TO t */
  {
    EXP_T_Event1_s * event2 = (EXP_T_Event1_s *) Escher_NewOoaEvent( (void *) v1, &EXP_T_Event1_sc );
    Escher_SendEvent( (OoaEvent_t *)event2 );
  }

}


/*****************************************************************************
 * Array of pointers to the object event dispather method.
 * Index is the (MC enumerated) number of the state model.
 ****************************************************************************/
static const EventTaker_t
EXP_EventDispatcher[ EXP_STATE_MODELS + 1 ] =
{
  (EventTaker_t) 0, /* Unused - instrumentation hook */
  (EventTaker_t) EXP_T_Dispatch
};


/*****************************************************************************
 ****************************************************************************/
void 
EXP_DomainDispatcher( OoaEvent_t * event )
{
  ( *EXP_EventDispatcher[ GetEventDestObjectNumber( event ) ] )( event );
}

/*****************************************************************************
 * System initialization method for domain: EXP
 ****************************************************************************/
void
IntializeDomain_EXP()
{
  /* Open object factories */
  EXP_T_FactoryInit();
}

/*****************************************************************************
 * System shutdown method for domain: EXP
 ****************************************************************************/
void
ShutdownDomain_EXP()
{
  /* Close object factories */
}