DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦5e3a56aee⟧ TextFile

    Length: 3651 (0xe43)
    Types: TextFile
    Names: »B«

Derivation

└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 

TextFile

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;