

[01;34mpackage[m [01;34mbody[m Libsens[31m.[mFrame [01;34mis[m
   
   [01;34mfunction[m [01;30mDigit_Random[m[31m([mDigit_Random_Generator [31m:[m [01;34min[m Digit_Random_Generator_Type[31m)[m [01;34mreturn[m Digit_Type [01;34mis[m
      New_Digit [31m:[m Digit_Type[31m;[m
   [01;34mbegin[m
      New_Digit[31m.[mClass_Id [31m:=[m Random_Class_Id[31m.[m[01;30mRandom[m[31m([mDigit_Random_Generator[31m.[mClass_Id_Gen[31m);[m
      New_Digit[31m.[mValue_Id [31m:=[m Random_Value_Id[31m.[m[01;30mRandom[m[31m([mDigit_Random_Generator[31m.[mValue_Id_Gen[31m);[m
      New_Digit[31m.[mData_Id [31m:=[m Random_Data_Id[31m.[m[01;30mRandom[m[31m([mDigit_Random_Generator[31m.[mData_Id_Gen[31m);[m
      [01;34mreturn[m New_Digit[31m;[m
   [01;34mend[m Digit_Random[31m;[m
   
   [31m-- Use case : "to succed"[m
   [01;34mfunction[m [01;30mTo_Succed[m [31m([mOld_Position [31m:[m [01;34min[m Position_Type[31m;[m
		       Successor    [31m:[m [01;34min[m Digit_Type[31m)[m [01;34mreturn[m Position_Type [01;34mis[m
      New_Position [31m:[m Position_Type [31m:=[m Old_Position[31m;[m
   [01;34mbegin[m
      new_position[31m.[mDigit [31m:=[m New_Position[31m.[mTemp[31m;[m
      new_position[31m.[mTemp [31m:=[m Successor[31m;[m
      [01;34mreturn[m New_Position[31m;[m
   [01;34mend[m To_Succed[31m;[m     
   
   
   [01;34mpackage[m [01;34mbody[m Frame_Rand [01;34mis[m
      
      [01;34mprocedure[m Reset [01;34mis[m
      [01;34mbegin[m
	 Random_Class_Id[31m.[m[01;30mReset[m[31m([mDigit_Generator[31m.[mClass_Id_Gen[31m,[m [35m7[m[31m);[m
	 Random_Value_Id[31m.[m[01;30mReset[m[31m([mDigit_Generator[31m.[mValue_Id_Gen[31m,[m [35m3[m[31m);[m
	 Random_Data_Id[31m.[m[01;30mReset[m[31m([mDigit_Generator[31m.[mData_Id_Gen[31m,[m [35m1[m[31m);[m
      [01;34mend[m Reset[31m;[m
      
      [01;34mprocedure[m [01;30mRandom[m [31m([mB_Inf           [31m:[m [01;34min[m Natural[31m;[m
			B_Sup           [31m:[m [01;34min[m Natural[31m;[m
			Digit_Generator [31m:[m [01;34min[m Digit_Random_Generator_Type[31m;[m
			Frame           [31m:[m    [01;34mout[m Frame_Type[31m)[m [01;34mis[m
	 
	 New_Frame [31m:[m Frame_Type [31m:=[m [31m(([m[01;34mothers[m [31m=>[m [31m(([mDigit_Default[31m,[m Digit_Default[31m),[m Digit_Default[31m)),[m B_Inf[31m,[m B_Sup[31m);[m
	 
      [01;34mbegin[m	 
	 [01;34mfor[m Series_Index [01;34min[m B_Inf[31m..[mB_Sup [01;34mloop[m
	    New_Frame[31m.[m[01;30mDigital_Series[m[31m([mSeries_Index[31m)[m [31m:=[m [31m([mPosition [31m=>[m [31m([m[01;30mDigit_Random[m[31m([mDigit_Generator[31m),[m 
								    [01;30mDigit_Random[m[31m([mDigit_Generator[31m)),[m 
						       Successor [31m=>[m [01;30mDigit_Random[m[31m([mDigit_Generator[31m));[m
	 [01;34mend[m [01;34mloop[m[31m;[m
	 Frame [31m:=[m New_Frame[31m;[m
      [01;34mend[m Random[31m;[m
      
      [01;34mfunction[m Frame_Random [01;34mreturn[m Frame_Type [01;34mis[m
	 
	 New_Frame [31m:[m Frame_Type[31m;[m
      [01;34mbegin[m	 
	 [01;30mRandom[m[31m([mMax_B_Inf[31m,[m Frame_Range_Rand[31m.[m[01;30mRandom[m[31m([mFrame_Range_Gen[31m),[m Digit_Generator[31m,[m New_Frame[31m);[m
	 [01;34mreturn[m New_Frame[31m;[m
      [01;34mend[m Frame_Random[31m;[m
   [01;34mend[m Frame_Rand[31m;[m
   
   
   [01;34mtype[m Digit_Counter_Type [01;34mis[m
      [01;34mrecord[m
	 Digit [31m:[m Digit_Type[31m;[m
	 Count [31m:[m Positive [31m:=[m [35m1[m[31m;[m
      [01;34mend[m [01;34mrecord[m[31m;[m
   
   [01;34mtype[m Digit_Counter_Table_Type [01;34mis[m [01;34marray[m [31m([mNatural [01;34mrange[m Max_B_Inf[31m..[mMax_B_Sup[31m)[m [01;34mof[m Digit_Counter_Type[31m;[m
      
   
   [01;34mfunction[m [01;30mFrame_Fitness[m [31m([mFrame [31m:[m [01;34min[m Frame_Type[31m)[m [01;34mreturn[m [32mFloat[m [01;34mis[m
      
      Fitness [31m:[m [32mFloat[m [31m:=[m [35m0.0[m[31m;[m
      
      
      Digit_Counter_Table [31m:[m Digit_Counter_Table_Type[31m;[m
      
      Current_Digit [31m:[m Digit_Type[31m;[m
      
      Bester [31m:[m [32mBoolean[m [31m:=[m False[31m;[m
      
   [01;34mbegin[m
      [01;34mfor[m Series_Index [01;34min[m Frame[31m.[mB_Inf[31m..[mFrame[31m.[mB_Sup [01;34mloop[m
	 [01;30mDigit_Counter_Table[m[31m([mSeries_Index[31m).[mDigit [31m:=[m Frame[31m.[m[01;30mDigital_Series[m[31m([mSeries_Index[31m).[mPosition[31m.[mDigit[31m;[m
      [01;34mend[m [01;34mloop[m[31m;[m
      
      [01;34mfor[m Digit_Index [01;34min[m Digit_Counter_Table'[01;34mRange[m [01;34mloop[m
	 Current_Digit [31m:=[m [01;30mDigit_Counter_Table[m[31m([mDigit_Index[31m).[mDigit[31m;[m
	 [01;34mfor[m Counter_Index [01;34min[m Digit_Index[31m+[m[35m1[m[31m..[mDigit_Counter_Table'Last [01;34mloop[m
	    [01;34mif[m [01;30mDigit_Counter_Table[m[31m([mCounter_Index[31m).[mDigit [31m=[m Current_Digit [01;34mthen[m
	       [01;30mDigit_Counter_Table[m[31m([mCounter_Index[31m).[mCount [31m:=[m [01;30mDigit_Counter_Table[m[31m([mCounter_Index[31m).[mCount [31m+[m [35m1[m[31m;[m
	    [01;34mend[m [01;34mif[m[31m;[m
	 [01;34mend[m [01;34mloop[m[31m;[m
      [01;34mend[m [01;34mloop[m[31m;[m
      
      [01;34mfor[m Digit_Index [01;34min[m Digit_Counter_Table'[01;34mRange[m [01;34mloop[m	 
	 [01;34mif[m [01;30mDigit_Counter_Table[m[31m([mDigit_Index[31m).[mCount [31m=[m [35m1[m [01;34mthen[m
	    Fitness [31m:=[m Fitness [31m+[m [35m1.0[m[31m;[m
	 [01;34melsif[m [01;30mDigit_Counter_Table[m[31m([mDigit_Index[31m).[mCount [31m>[m [35m2[m [01;34mthen[m
	    Fitness [31m:=[m Fitness [31m-[m [35m1.0[m[31m;[m
	 [01;34mend[m [01;34mif[m[31m;[m
      [01;34mend[m [01;34mloop[m[31m;[m
      [01;34mfor[m Counter_Index [01;34min[m Digit_Counter_Table'[01;34mRange[m [01;34mloop[m
	 [01;34mif[m [01;30mDigit_Counter_Table[m[31m([mCounter_Index[31m).[mCount [31m=[m [35m2[m [01;34mthen[m
	    [01;34mif[m Bester [01;34mthen[m
	       Bester [31m:=[m False[31m;[m
	       [01;34mexit[m[31m;[m
	    [01;34melse[m
	       Bester [31m:=[m True[31m;[m
	    [01;34mend[m [01;34mif[m[31m;[m
	 [01;34mend[m [01;34mif[m[31m;[m
      [01;34mend[m [01;34mloop[m[31m;[m
      [01;34mif[m Bester [01;34mthen[m
	 Fitness [31m:=[m Fitness [31m*[m [35m2.0[m[31m;[m
      [01;34mend[m [01;34mif[m[31m;[m
      [01;34mreturn[m Fitness[31m;[m
   [01;34mend[m Frame_Fitness[31m;[m
   
   
   [01;34mfunction[m [01;30mFrame_Mate[m [31m([mLeft_Frame [31m:[m [01;34min[m Frame_Type[31m;[m
			Right_Frame [31m:[m [01;34min[m Frame_Type[31m)[m [01;34mreturn[m Frame_Type [01;34mis[m
      
     New_Frame [31m:[m Frame_Type [31m:=[m Left_Frame[31m;[m
   [01;34mbegin[m
      
      [01;34mfor[m Series_Index [01;34min[m New_Frame[31m.[mB_Inf[31m..[mNew_Frame[31m.[mB_Sup [01;34mloop[m
	 
	 New_Frame[31m.[m[01;30mDigital_Series[m[31m([mSeries_Index[31m).[mPosition [31m:=[m 
	   [01;30mTo_Succed[m[31m([mNew_Frame[31m.[m[01;30mDigital_Series[m[31m([mSeries_Index[31m).[mPosition[31m,[m
		     Right_Frame[31m.[m[01;30mDigital_Series[m[31m([mSeries_Index[31m).[mSuccessor[31m);[m
      [01;34mend[m [01;34mloop[m[31m;[m
	
      [01;34mreturn[m New_Frame[31m;[m
   [01;34mend[m Frame_Mate[31m;[m
   
   [01;34mprocedure[m [01;30mFrame_Mutate[m [31m([mOld_Frame [31m:[m [01;34min[m [01;34mout[m Frame_Type[31m)[m [01;34mis[m
      
      New_Frame [31m:[m Frame_Type [31m:=[m Old_Frame[31m;[m
   [01;34mbegin[m
      
      [01;34mfor[m Series_Index [01;34min[m New_Frame[31m.[mB_Inf[31m..[mNew_Frame[31m.[mB_Sup [01;34mloop[m
	 
	 New_Frame[31m.[m[01;30mDigital_Series[m[31m([mSeries_Index[31m).[mPosition [31m:=[m 
	   [01;30mTo_Succed[m[31m([mNew_Frame[31m.[m[01;30mDigital_Series[m[31m([mSeries_Index[31m).[mPosition[31m,[m
		     New_Frame[31m.[m[01;30mDigital_Series[m[31m([mSeries_Index[31m).[mSuccessor[31m);[m
      [01;34mend[m [01;34mloop[m[31m;[m
      
      Old_Frame [31m:=[m New_Frame[31m;[m
   [01;34mend[m Frame_Mutate[31m;[m
      
[01;34mend[m Libsens[31m.[mFrame[31m;[m
