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

⟦7674d6a2d⟧ Ada Source

    Length: 6144 (0x1800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Give_Work_To_A_Robot_Rule, seg_04b348, separate Bgrb2_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



separate (Bgrb2_Rule_Bundle)

package body Give_Work_To_A_Robot_Rule is
    use Bgrb2_Frames;
    use Fact_Base;

    function Premiss return Fact_Queries is
        The_Size     : constant Alias.Name := Alias.S;  
        The_Robot_Id : constant Alias.Name := Alias.I;
        The_Number   : constant Alias.Name := Alias.N;
    begin
        return (Bricks.Exist
                   ((Size  => Predicate.Define_As (The_Size),
                     Place =>
                        Predicate.System_Defined_Predicate.Is_Equal (On_Heap))),


                Bricks.Absent
                   ((Size  =>
                        Fact_Base.Predicate.System_Defined_Predicate.Is_Greater
                           (The_Size),
                     Place =>
                        Predicate.System_Defined_Predicate.Is_Equal (On_Heap))),


                Robots.Exist
                   ((Action     =>
                        Predicate.System_Defined_Predicate.Is_Equal (Taking),  
                     Working    =>
                        Predicate.System_Defined_Predicate.Is_Equal (No),  
                     Identifier => Predicate.Define_As (The_Robot_Id))),


                Boxes.Exist
                   ((Number => Predicate.Define_As (The_Number),
                     State  =>
                        Predicate.System_Defined_Predicate.Is_Equal (Empty))),



                Boxes.Absent
                   ((Number =>
                        Predicate.System_Defined_Predicate.Is_Less (The_Number),
                     State  =>
                        Predicate.System_Defined_Predicate.Is_Equal (Empty))));


    end Premiss;


    procedure Action (Objects : Fact_Collection) is

        The_Biggest_Brick : Fact_Name renames Objects (1);  
        The_Robot : Fact_Name renames Objects (3);
        The_Box : Fact_Name renames Objects (4);
        On_Screen : Output_Stream.Object := Output_Stream.Standard_Output;
        The_Robot_Identifier : Slot.Object;
        The_Box_Number : Slot.Object;
    begin
        Output_Stream.New_Line (On_Screen);
        Output_Stream.Put_Line
           (" --------------------------------------------------------------",
            On_Screen);
        Output_Stream.Put_Line
           (" -- A NOT WORKING ROBOT WAS CHOSEN TO TAKE THE BIGGEST BRICK --",
            On_Screen);  
        Output_Stream.Put_Line
           (" --      FROM HEAP TO PUT IT IN THE FIRST FREE BOX           --",
            On_Screen);
        Output_Stream.Put_Line
           (" --------------------------------------------------------------",
            On_Screen);
        Output_Stream.New_Line (On_Screen);

        Boxes.Change (The_Box, State, Reserved);
        Robots.Change (The_Robot, Working, Yes);
        Bricks.Change (The_Biggest_Brick, Place, In_Pliers);

        The_Robot_Identifier := Robots.Get (The_Robot, Identifier);
        The_Box_Number       := Boxes.Get (The_Box, Box_Slots (Number));

        Bricks.Change (The_Biggest_Brick, Place, The_Box_Number);

        if (Slot.Get (The_Robot_Identifier) = "Robot1") then
            Bgrb2_Physical_Robots.The_Robot_1.Work
               (The_Robot, The_Biggest_Brick, The_Box, The_Box_Number);
        elsif (Slot.Get (The_Robot_Identifier) = "Robot2") then
            Bgrb2_Physical_Robots.The_Robot_2.Work
               (The_Robot, The_Biggest_Brick, The_Box, The_Box_Number);
        elsif (Slot.Get (The_Robot_Identifier) = "Robot3") then
            Bgrb2_Physical_Robots.The_Robot_3.Work
               (The_Robot, The_Biggest_Brick, The_Box, The_Box_Number);
        else
            null;
        end if;
        Output_Stream.New_Line (On_Screen);
    end Action;

end Give_Work_To_A_Robot_Rule;

E3 Meta Data

    nblk1=5
    nid=5
    hdr6=8
        [0x00] rec0=1d rec1=00 rec2=01 rec3=082
        [0x01] rec0=1c rec1=00 rec2=02 rec3=086
        [0x02] rec0=18 rec1=00 rec2=03 rec3=01c
        [0x03] rec0=14 rec1=00 rec2=04 rec3=000
        [0x04] rec0=12 rec1=00 rec2=02 rec3=000
    tail 0x2174feabc867c39704be5 0x42a00088462063c03
Free Block Chain:
  0x5: 0000  00 00 03 61 80 38 4e 75 6d 62 65 72 20 20 20 20  ┆   a 8Number    ┆