DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦8ad1650f9⟧ Ada Source

    Length: 11264 (0x2c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Quadrant_A_Update_Rule, seg_04cb53, separate Qualit_Generic_Agent.Qualit_Update_Rule_Bundle

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with System_Utilities;
with Time_Utilities;
with Alias;

separate (Qualit_Generic_Agent.Qualit_Update_Rule_Bundle)

package body Quadrant_A_Update_Rule is


    function Premiss return Fact_Queries is
        use Qualit_Frames;
        use Slot;
        use Slot.Operators;
        The_Near_Delta_Y_Max_Val : constant Alias.Name := Alias.N;
    begin
        return (Updates.Exist ((Valid => Is_Equal (True_Boolean))),
                Epsilons.Exist ((Value => Is_Less (Null_Value))),
                Plus_Near_Delta_Y_Maxs.Exist
                   ((Value => Define_As (The_Near_Delta_Y_Max_Val))),
                Delta_Ys.Exist ((Value => Is_Less_Or_Equal
                                             (The_Near_Delta_Y_Max_Val))),

                Epsilon_Variations.Exist ((Value => Is_Any)),
                Variation_Of_Epsilon_Variations.Exist ((Value => Is_Any)),
                Current_Positions.Exist ((Value => Is_Any)),
                Up_Values.Exist ((Value => Is_Any)),
                Up_Increments.Exist ((Value => Is_Any)),
                Positions_To_Reach.Exist ((Value => Is_Any)),
                Plus_Delta_Y_Maxs.Exist ((Value => Is_Any)),
                Delta_Y_Max_Reached_In_Bs.Exist ((Value => Is_Any)),
                Minus_Near_Delta_Y_Maxs.Exist ((Value => Is_Any)));
    end Premiss;


    procedure Action (Objects : Fact_Collection) is
        use Qualit_Frames;
        use Slot;
        use Slot.Operators;  
        The_Update_Fact : Fact_Name renames Objects (1);
        The_Epsilon_Fact : Fact_Name renames Objects (2);  
        The_Plus_Near_Delta_Y_Max_Fact : Fact_Name renames Objects (3);
        The_Delta_Y_Fact : Fact_Name renames Objects (4);
        The_Epsilon_Variation_Fact : Fact_Name renames Objects (5);
        The_Variation_Of_Epsilon_Variation_Fact : Fact_Name renames Objects (6);
        The_Actual_Pos_Fact : Fact_Name renames Objects (7);
        The_Up_Value_Fact : Fact_Name renames Objects (8);
        The_Up_Increment_Fact : Fact_Name renames Objects (9);
        The_Pos_To_Reach_Fact : Fact_Name renames Objects (10);
        The_Delta_Y_Max_Fact : Fact_Name renames Objects (11);
        The_Delta_Y_Max_Reached_In_B_Fact : Fact_Name renames Objects (12);
        The_Minus_Near_Delta_Y_Max_Fact : Fact_Name renames Objects (13);

        The_Old_Actual_Pos : Slot.Object :=
           Current_Positions.Get (The_Actual_Pos_Fact, Value);
        The_Old_Delta_Y_Val : Slot.Object :=
           Delta_Ys.Get (The_Delta_Y_Fact, Value);
        The_Pos_To_Reach : Slot.Object :=
           Positions_To_Reach.Get (The_Pos_To_Reach_Fact, Value);
        The_Old_Epsilon_Val : Slot.Object :=
           Epsilons.Get (The_Epsilon_Fact, Value);
        The_Old_Epsilon_Variation_Val : Slot.Object :=
           Epsilon_Variations.Get (The_Epsilon_Variation_Fact, Value);
        The_Old_Variation_Of_The_Epsilon_Val : Slot.Object :=
           Variation_Of_Epsilon_Variations.Get
              (The_Variation_Of_Epsilon_Variation_Fact, Value);
        The_Up_Val : Slot.Object := Up_Values.Get (The_Up_Value_Fact, Value);
        The_Near_Delta_Y_Val : Slot.Object :=
           Plus_Near_Delta_Y_Maxs.Get (The_Plus_Near_Delta_Y_Max_Fact, Value);
        The_Delta_Y_Max_Val : Slot.Object :=
           Plus_Delta_Y_Maxs.Get (The_Delta_Y_Max_Fact, Value);
        The_Delta_Y_Max_Reached_In_B_Val : Slot.Object :=
           Delta_Y_Max_Reached_In_Bs.Get
              (The_Delta_Y_Max_Reached_In_B_Fact, Value);

        The_New_Actual_Pos           : Slot.Object;
        The_New_Delta_Y_Val          : Slot.Object;
        The_New_Epsilon_Val          : Slot.Object;
        The_New_Epsilon_Variation    : Slot.Object;
        The_Agent2_Pos               : Slot.Object;  
        The_Elapsed_Time_In_Millisec : Integer;
        The_Time_Interval            : Time_Utilities.Interval;
    begin
        Display.New_Line (The_Output_Window);
        Display.Put_Line
           ("********************************************************",
            The_Output_Window);
        Display.Put_Line ("      quadrant A : UPDATE RULE ", The_Output_Window);
        Display.Put_Line
           ("********************************************************",
            The_Output_Window);


        Updates.Change (The_Update_Fact, Valid, False_Boolean);

        The_New_Actual_Pos := Get_Position (Agent_Id);

        Current_Positions.Change
           (The_Actual_Pos_Fact, Value, The_New_Actual_Pos);

        Set_Position_Variation (Agent_Id, The_Up_Val);

        The_Agent2_Pos      := Get_Position (The_Other_Agent);
        The_New_Delta_Y_Val := The_New_Actual_Pos - The_Agent2_Pos;  
        Delta_Ys.Change (The_Delta_Y_Fact, Value, The_New_Delta_Y_Val);


        The_New_Epsilon_Val := The_New_Actual_Pos - The_Pos_To_Reach;
        Epsilons.Change (The_Epsilon_Fact, Value, The_New_Epsilon_Val);

        The_New_Epsilon_Variation := The_New_Epsilon_Val - The_Old_Epsilon_Val;
        Epsilon_Variations.Change (The_Epsilon_Variation_Fact, Value,
                                   The_New_Epsilon_Variation);

        Variation_Of_Epsilon_Variations.Change
           (The_Variation_Of_Epsilon_Variation_Fact, Value,
            The_New_Epsilon_Variation - The_Old_Epsilon_Variation_Val);

        Up_Increments.Change (The_Up_Increment_Fact, Value, Inc_Max);

        if (The_Delta_Y_Max_Reached_In_B_Val > Null_Value) then
            if (Get (The_Delta_Y_Max_Reached_In_B_Val) <
                (Integer (Integer'(Get (The_Delta_Y_Max_Val)) * 0.9))) then
                Plus_Near_Delta_Y_Maxs.Change
                   (The_Plus_Near_Delta_Y_Max_Fact, Value,
                    (The_Near_Delta_Y_Val + The_Delta_Y_Max_Val -
                     The_Delta_Y_Max_Reached_In_B_Val));
                Minus_Near_Delta_Y_Maxs.Change
                   (The_Minus_Near_Delta_Y_Max_Fact, Value,
                    (-The_Near_Delta_Y_Val - The_Delta_Y_Max_Val +
                     The_Delta_Y_Max_Reached_In_B_Val));
            end if;
            Delta_Y_Max_Reached_In_Bs.Change
               (The_Delta_Y_Max_Reached_In_B_Fact, Value, Null_Value);
        end if;

        Display.Put ("The current position is :", The_Output_Window);
        Display.Put_Line (Integer'Image (Get (The_New_Actual_Pos)),
                          The_Output_Window);
        Display.Put ("The up commande is :", The_Output_Window);
        Display.Put_Line (Integer'Image (Get (The_Up_Val)), The_Output_Window);
        Display.Put ("The delta y val is :", The_Output_Window);
        Display.Put_Line (Integer'Image (Get (The_New_Delta_Y_Val)),
                          The_Output_Window);
        Display.New_Line (The_Output_Window);


        The_Time_Interval := Time_Utilities.Convert (System_Utilities.Elapsed);
        The_Elapsed_Time_In_Millisec :=
           Integer (The_Time_Interval.Elapsed_Minutes) * 60000;
        The_Elapsed_Time_In_Millisec :=
           The_Elapsed_Time_In_Millisec +
              (Integer (The_Time_Interval.Elapsed_Seconds) * 1000);
        The_Elapsed_Time_In_Millisec :=
           The_Elapsed_Time_In_Millisec +
              Integer (The_Time_Interval.Elapsed_Milliseconds);

        Qualit_Result_File_Maker.Write
           (The_Output_File,
            Integer'Image (The_Elapsed_Time_In_Millisec) &
               " " & Integer'Image (Get (The_New_Actual_Pos)) &
               " " & Integer'Image (Get (The_Up_Val)) & " " &
               Integer'Image (Get (The_New_Delta_Y_Val)) &
               Integer'Image (Get (The_Near_Delta_Y_Val)) & " A");
    end Action;


end Quadrant_A_Update_Rule;

E3 Meta Data

    nblk1=a
    nid=0
    hdr6=14
        [0x00] rec0=1b rec1=00 rec2=01 rec3=03e
        [0x01] rec0=14 rec1=00 rec2=08 rec3=044
        [0x02] rec0=12 rec1=00 rec2=02 rec3=028
        [0x03] rec0=13 rec1=00 rec2=09 rec3=044
        [0x04] rec0=03 rec1=00 rec2=0a rec3=006
        [0x05] rec0=19 rec1=00 rec2=05 rec3=030
        [0x06] rec0=13 rec1=00 rec2=07 rec3=026
        [0x07] rec0=09 rec1=00 rec2=06 rec3=014
        [0x08] rec0=15 rec1=00 rec2=03 rec3=008
        [0x09] rec0=08 rec1=00 rec2=04 rec3=001
    tail 0x21753cd66871b3511954e 0x42a00088462063c03