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

⟦b7813c135⟧ Ada Source

    Length: 8192 (0x2000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Robots_Bricks_Actions, seg_011f17

Derivation

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

E3 Source Code



with Instance, Slot, Text_Io, Slot, Tuple,
     Robot_Features, Brick_Features, Robot, Brick;

package body Robots_Bricks_Actions is

    use Robot_Features, Brick_Features, Slot.Operators;

    Current_Number : Integer := 1;

    Old_Number : Integer := 1;

    function Last_Box return Integer is
    begin
        Current_Number := Current_Number + 1;
        return Current_Number - 1;
    end Last_Box;


    function Next_Old return Integer is
    begin
        Old_Number := Old_Number + 1;
        return Old_Number;
    end Next_Old;



    ------------------------------------------------------------

    procedure Pack_It_Action (The_Tuple : Tuple.Object) is
        A_Brick : Brick.Object;
        A_Robot : Robot.Object;
        Chaine  : String (1 .. 15);
    begin  
        Tuple.Split (The_Tuple, A_Brick, A_Robot);
        Brick.Change (The_Object => A_Brick,
                      Attribute  => Place,
                      To         => In_The_Nippers);
        Robot.Change (The_Object => A_Robot,
                      Attribute  => Is_Busy,
                      To         => Slot.Value (True));

        Text_Io.Put_Line ("=>Rule PACK_IT :");
        Text_Io.Put_Line ("       the robot (" &
                          Slot.Image (Robot.Value_Of (A_Robot, Name)) &
                          ")takes the greater Brick (size= " &
                          Slot.Image (Brick.Value_Of (A_Brick, Size)) &
                          ") in his nippers");
    end Pack_It_Action;

    ------------------------------------------------------------
    procedure Take_Test_Action (The_Tuple : Tuple.Object) is
        A_Robot : Robot.Object;
        A_Brick : Brick.Object;
    begin
        Tuple.Split (The_Tuple, A_Brick, A_Robot);
        Robot.Change (The_Object => A_Robot,
                      Attribute  => The_Task,
                      To         => State_Slot_Tasks.Value (Put));
        Robot.Change (The_Object => A_Robot,
                      Attribute  => Old,
                      To         => Slot.Value (Next_Old));

        Text_Io.Put_Line ("=>Rule get_test_action : the robot (" &
                          Slot.Image (Robot.Value_Of (A_Robot, Name)) &
                          ")is going to put the  Brick ");

    end Take_Test_Action;

    ------------------------------------------------------------
    procedure Put_To_Case_Test_Action (The_Tuple : Tuple.Object) is
        A_Robot : Robot.Object;
        A_Brick : Brick.Object;
    begin
        Tuple.Split (The_Tuple, A_Brick, A_Robot);
        Brick.Change (The_Object => A_Brick,
                      Attribute  => Place,
                      To         => In_The_Box);

        Robot.Change (The_Object => A_Robot,
                      Attribute  => The_Task,
                      To         => State_Slot_Tasks.Value (Take));

        Robot.Change (The_Object => A_Robot,
                      Attribute  => Box,
                      To         => Slot.Value (Last_Box));

        Brick.Change (The_Object => A_Brick,
                      Attribute  => Boite,
                      To         => Robot.Value_Of (A_Robot, Box));


        Text_Io.Put_Line ("=>Rule to_case_teste__action :");
        Text_Io.Put_Line ("the robot (" &
                          Slot.Image (Robot.Value_Of (A_Robot, Name)) &
                          ")puts the Brick in  case " &
                          Slot.Image (Robot.Value_Of (A_Robot, Box)));

        Robot.Change (The_Object => A_Robot,
                      Attribute  => Is_Busy,
                      To         => Slot.Value (False));
    end Put_To_Case_Test_Action;


end Robots_Bricks_Actions;

E3 Meta Data

    nblk1=7
    nid=7
    hdr6=8
        [0x00] rec0=21 rec1=00 rec2=01 rec3=046
        [0x01] rec0=17 rec1=00 rec2=02 rec3=05e
        [0x02] rec0=18 rec1=00 rec2=03 rec3=04c
        [0x03] rec0=1a rec1=00 rec2=06 rec3=000
        [0x04] rec0=1a rec1=00 rec2=06 rec3=000
        [0x05] rec0=1a rec1=00 rec2=02 rec3=000
        [0x06] rec0=00 rec1=3d rec2=41 rec3=075
    tail 0x2150d3aba8246730c3500 0x42a00088462063c03
Free Block Chain:
  0x7: 0000  00 05 00 04 80 01 3b 01 02 03 04 05 06 07 08 20  ┆      ;         ┆
  0x5: 0000  00 04 03 c7 80 15 65 5f 4f 62 6a 65 63 74 20 3d  ┆      e_Object =┆
  0x4: 0000  00 00 03 fc 80 03 73 6b 2c 03 00 42 20 20 20 20  ┆      sk,  B    ┆