static FUNCTION1( void AR000, hcg_key, EIid ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR000:\n"); AIid = EventInstanceGetAIid2(EIid); printf(" EventInstance ID: %x\n", EIid); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } EventCount++; // printf(" Sending AGR1 to One Instance\n"); // GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR1", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); // printf(" Sending AGR2 to Two Instance\n"); //GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR2", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); printf("AR000 done\n\n"); } static FUNCTION3( void AR001, hcg_key, EIid1, hcg_key, EIid2, char, w ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR001:\n"); if (G001) { AIid = EventInstanceGetAIid2(EIid1); printf(" EventInstance ID: %x\n", EIid1); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); } else { AIid = EventInstanceGetAIid2(EIid2); printf(" EventInstance ID: %x\n", EIid2); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); } STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } EventCount++; printf(" Sending AGR2 to One Instance\n"); /* GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR2", -EventCount, EventCount, 0.0, EventCount * 1.1, "something"); printf(" Sending AGR1 to Two Instance\n"); GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR1", -EventCount, EventCount, 0.0, EventCount * 1.1, "something else");*/ printf("AR001 done\n\n"); } static FUNCTION3( void AR002, hcg_key, EIid1, hcg_key, EIid2, char, w ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR002:\n"); if (G002) { AIid = EventInstanceGetAIid2(EIid1); printf(" EventInstance ID: %x\n", EIid1); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); } else { AIid = EventInstanceGetAIid2(EIid2); printf(" EventInstance ID: %x\n", EIid2); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); } STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } EventCount++; printf(" Sending AGR2 to One Instance\n"); /* GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR2", -EventCount, EventCount, 0.0, EventCount * 1.1, "something"); printf(" Sending AGR1 to Two Instance\n"); GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR1", -EventCount, EventCount, 0.0, EventCount * 1.1, "something else");*/ printf("AR002 done\n\n"); } static FUNCTION2( void AR003, hcg_key, EIid, int *, count ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR003:\n"); AIid = EventInstanceGetAIid2(EIid); printf(" EventInstance ID: %x\n", EIid); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } (*count)++; EventCount++; // printf(" Sending AGR1 to One Instance\n"); // GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR1", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); // printf(" Sending AGR2 to Two Instance\n"); //GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR2", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); printf("AR003 done\n\n"); } static FUNCTION2( void AR004, hcg_key, EIid, int *, count ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR004:\n"); AIid = EventInstanceGetAIid2(EIid); printf(" EventInstance ID: %x\n", EIid); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } *count = 0; EventCount++; // printf(" Sending AGR1 to One Instance\n"); // GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR1", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); // printf(" Sending AGR2 to Two Instance\n"); //GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR2", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); printf("AR004 done\n\n"); } static FUNCTION2( void AR005, hcg_key, EIid, char, w ) {/* hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR005:\n"); AIid = EventInstanceGetAIid2(EIid); printf(" EventInstance ID: %x\n", EIid); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } EventCount++; // printf(" Sending AGR1 to One Instance\n"); // GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR1", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); // printf(" Sending AGR2 to Two Instance\n"); //GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR2", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); printf("AR005 done\n\n"); }*/ static FUNCTION2( void AR006, hcg_key, EIid ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR006:\n"); AIid = EventInstanceGetAIid2(EIid); printf(" EventInstance ID: %x\n", EIid); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } (*count)++; EventCount++; // printf(" Sending AGR1 to One Instance\n"); // GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR1", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); // printf(" Sending AGR2 to Two Instance\n"); //GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR2", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); printf("AR006 done\n\n"); } static FUNCTION2( void AR007, hcg_key, EIid ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR007:\n"); AIid = EventInstanceGetAIid2(EIid); printf(" EventInstance ID: %x\n", EIid); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } printf("Error, integer exceed 32 bits! \n\n") exit(0); EventCount++; // printf(" Sending AGR1 to One Instance\n"); // GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR1", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); // printf(" Sending AGR2 to Two Instance\n"); //GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR2", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); printf("AR007 done\n\n"); } static FUNCTION1( int G001, char w ) { if((int)w <= && (int)w >= ) return 1; else return 0; } static FUNCTION1( int G002, int count ) { if(count <= 32 ) return 1; else return 0; } static FUNCTION1( void AR100, hcg_key, EIid ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR100:\n"); AIid = EventInstanceGetAIid2(EIid); printf(" EventInstance ID: %x\n", EIid); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } EventCount++; // printf(" Sending AGR1 to One Instance\n"); // GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR1", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); // printf(" Sending AGR2 to Two Instance\n"); //GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR2", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); printf("AR100 done\n\n"); } static FUNCTION3( void AR101, hcg_key, EIid1, hcg_key, EIid2, char, w ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR101:\n"); if (G101) { AIid = EventInstanceGetAIid2(EIid1); printf(" EventInstance ID: %x\n", EIid1); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); } else { AIid = EventInstanceGetAIid2(EIid2); printf(" EventInstance ID: %x\n", EIid2); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); } STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } EventCount++; printf(" Sending AGR2 to One Instance\n"); /* GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR2", -EventCount, EventCount, 0.0, EventCount * 1.1, "something"); printf(" Sending AGR1 to Two Instance\n"); GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR1", -EventCount, EventCount, 0.0, EventCount * 1.1, "something else");*/ printf("AR101 done\n\n"); } static FUNCTION3( void AR102, hcg_key, EIid1, hcg_key, EIid2, char, w ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR102:\n"); if (G102) { AIid = EventInstanceGetAIid2(EIid1); printf(" EventInstance ID: %x\n", EIid1); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); } else { AIid = EventInstanceGetAIid2(EIid2); printf(" EventInstance ID: %x\n", EIid2); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); } STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } EventCount++; printf(" Sending AGR2 to One Instance\n"); /* GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR2", -EventCount, EventCount, 0.0, EventCount * 1.1, "something"); printf(" Sending AGR1 to Two Instance\n"); GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR1", -EventCount, EventCount, 0.0, EventCount * 1.1, "something else");*/ printf("AR102 done\n\n"); } static FUNCTION2( void AR103, hcg_key, EIid, int *, count ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR103:\n"); AIid = EventInstanceGetAIid2(EIid); printf(" EventInstance ID: %x\n", EIid); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } (*count)++; EventCount++; // printf(" Sending AGR1 to One Instance\n"); // GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR1", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); // printf(" Sending AGR2 to Two Instance\n"); //GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR2", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); printf("AR103 done\n\n"); } static FUNCTION2( void AR104, hcg_key, EIid, int *, count ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR104:\n"); AIid = EventInstanceGetAIid2(EIid); printf(" EventInstance ID: %x\n", EIid); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } *count = 0; EventCount++; // printf(" Sending AGR1 to One Instance\n"); // GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR1", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); // printf(" Sending AGR2 to Two Instance\n"); //GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR2", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); printf("AR104 done\n\n"); } static FUNCTION2( void AR105, hcg_key, EIid, char, w ) {/* hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR105:\n"); AIid = EventInstanceGetAIid2(EIid); printf(" EventInstance ID: %x\n", EIid); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } EventCount++; // printf(" Sending AGR1 to One Instance\n"); // GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR1", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); // printf(" Sending AGR2 to Two Instance\n"); //GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR2", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); printf("AR105 done\n\n"); }*/ static FUNCTION2( void AR106, hcg_key, EIid ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR106:\n"); AIid = EventInstanceGetAIid2(EIid); printf(" EventInstance ID: %x\n", EIid); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } (*count)++; EventCount++; // printf(" Sending AGR1 to One Instance\n"); // GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR1", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); // printf(" Sending AGR2 to Two Instance\n"); //GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR2", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); printf("AR106 done\n\n"); } static FUNCTION2( void AR107, hcg_key, EIid ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR107:\n"); AIid = EventInstanceGetAIid2(EIid); printf(" EventInstance ID: %x\n", EIid); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } printf("Error, string exceed 32 bits! \n\n") exit(0); EventCount++; // printf(" Sending AGR1 to One Instance\n"); // GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR1", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); // printf(" Sending AGR2 to Two Instance\n"); //GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR2", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); printf("AR107 done\n\n"); } static FUNCTION1( int G101, char w ) { if((int)w <= && (int)w >= ) return 1; else return 0; } static FUNCTION1( int G102, int count ) { if(count <= 32 ) return 1; else return 0; } static FUNCTION1( void AR200, hcg_key, EIid ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR200:\n"); AIid = EventInstanceGetAIid2(EIid); printf(" EventInstance ID: %x\n", EIid); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } EventCount++; // printf(" Sending AGR1 to One Instance\n"); // GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR1", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); // printf(" Sending AGR2 to Two Instance\n"); //GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR2", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); printf("AR200 done\n\n"); } static FUNCTION3( void AR201, hcg_key, EIid1, hcg_key, EIid2, char, w ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR201:\n"); if (G201) { AIid = EventInstanceGetAIid2(EIid1); printf(" EventInstance ID: %x\n", EIid1); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); } else { AIid = EventInstanceGetAIid2(EIid2); printf(" EventInstance ID: %x\n", EIid2); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); } STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } EventCount++; printf(" Sending AGR2 to One Instance\n"); /* GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR2", -EventCount, EventCount, 0.0, EventCount * 1.1, "something"); printf(" Sending AGR1 to Two Instance\n"); GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR1", -EventCount, EventCount, 0.0, EventCount * 1.1, "something else");*/ printf("AR201 done\n\n"); } static FUNCTION3( void AR202, hcg_key, EIid1, hcg_key, EIid2, char, w ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR202:\n"); if (G202) { AIid = EventInstanceGetAIid2(EIid1); printf(" EventInstance ID: %x\n", EIid1); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); } else { AIid = EventInstanceGetAIid2(EIid2); printf(" EventInstance ID: %x\n", EIid2); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); } STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } EventCount++; printf(" Sending AGR2 to One Instance\n"); /* GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR2", -EventCount, EventCount, 0.0, EventCount * 1.1, "something"); printf(" Sending AGR1 to Two Instance\n"); GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR1", -EventCount, EventCount, 0.0, EventCount * 1.1, "something else");*/ printf("AR102 done\n\n"); } static FUNCTION2( void AR103, hcg_key, EIid, int *, count ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR103:\n"); AIid = EventInstanceGetAIid2(EIid); printf(" EventInstance ID: %x\n", EIid); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } (*count)++; EventCount++; // printf(" Sending AGR1 to One Instance\n"); // GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR1", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); // printf(" Sending AGR2 to Two Instance\n"); //GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR2", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); printf("AR103 done\n\n"); } static FUNCTION2( void AR104, hcg_key, EIid, int *, count ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR104:\n"); AIid = EventInstanceGetAIid2(EIid); printf(" EventInstance ID: %x\n", EIid); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } *count = 0; EventCount++; // printf(" Sending AGR1 to One Instance\n"); // GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR1", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); // printf(" Sending AGR2 to Two Instance\n"); //GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR2", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); printf("AR104 done\n\n"); } static FUNCTION2( void AR105, hcg_key, EIid, char, w ) {/* hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR105:\n"); AIid = EventInstanceGetAIid2(EIid); printf(" EventInstance ID: %x\n", EIid); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } EventCount++; // printf(" Sending AGR1 to One Instance\n"); // GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR1", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); // printf(" Sending AGR2 to Two Instance\n"); //GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR2", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); printf("AR105 done\n\n"); }*/ static FUNCTION2( void AR106, hcg_key, EIid ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR106:\n"); AIid = EventInstanceGetAIid2(EIid); printf(" EventInstance ID: %x\n", EIid); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } (*count)++; EventCount++; // printf(" Sending AGR1 to One Instance\n"); // GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR1", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); // printf(" Sending AGR2 to Two Instance\n"); //GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR2", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); printf("AR106 done\n\n"); } static FUNCTION2( void AR107, hcg_key, EIid ) { hcg_key AIid; hcg_key STid; char CurState[StatesNameMaxLen+1]; printf("This is AR107:\n"); AIid = EventInstanceGetAIid2(EIid); printf(" EventInstance ID: %x\n", EIid); ActiveInstanceCopyState(AIid, CurState); printf(" now in state %s\n", CurState); STid = StateFirst(); while (STid != 0) { if (strcmp(CurState, StateGetName(STid)) == 0) { break; } STid = StateNext(STid); } if (STid == 0) { printf(" can't find such a state\n"); } else { printf(" should be executing %s\n", StateGetActName(STid)); } printf("Error, string exceed 32 bits! \n\n") exit(0); EventCount++; // printf(" Sending AGR1 to One Instance\n"); // GenerateEvent(ActiveInstanceGetName(AIid), "One Instance", "AGR1", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); // printf(" Sending AGR2 to Two Instance\n"); //GenerateEvent(ActiveInstanceGetName(AIid), "Two Instance", "AGR2", // EventCount, -EventCount, EventCount * 1.1, 0.0, 0); printf("AR107 done\n\n"); } static FUNCTION1( int G101, char w ) { if((int)w <= && (int)w >= ) return 1; else return 0; } static FUNCTION1( int G102, int count ) { if(count <= 32 ) return 1; else return 0; }