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

⟦23b8e83fa⟧ TextFile

    Length: 7898 (0x1eda)
    Types: TextFile
    Names: »B«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Expertsystem;
with Robot_New, Brick_New;
procedure Mise_En_Casier is

    package Robotetbrique is
        procedure Miseenboite;
    end Robotetbrique;

    package body Robotetbrique is

        Casier : Natural := 0;
        A_Brick, A_Robot : Expertsystem.Reference;

        function Peutmettreenboite return Boolean is
        begin
            Regle_Caser:
                --  (classe => robot, tache => deposer, case => <c>)
                --  (classe => brique, lieu => pince)
                ------------------------------------------------------
                declare
                    function Robot_Match
                                (R : Expertsystem.Reference) return Boolean is
                    begin
                        return Robot_New.Is_The_Task
                                  (Of_Robot => R,
                                   The_Task => Robot_New.Deposer);
                    end Robot_Match;

                    function Brick_Match
                                (B : Expertsystem.Reference) return Boolean is
                    begin
                        return Brick_New.Is_The_Place
                                  (Of_Brick => B, The_Place => Brick_New.Pince);
                    end Brick_Match;

                    function Robot_Ok is
                       new Expertsystem.Collection.Findone (Robot_Match);
                    function Brick_Ok is
                       new Expertsystem.Collection.Findone (Brick_Match);

                begin  
                    A_Robot := Robot_Ok (Robot_New.All_Robots);
                    A_Brick := Brick_Ok (Brick_New.All_Bricks);
                    if Expertsystem.Collection.Isnotnull (A_Robot) and
                       Expertsystem.Collection.Isnotnull (A_Brick) then
                        Brick_New.Modify (A_Brick,
                                          The_Place => Brick_New.Boite);
                        Robot_New.Modify (A_Robot,
                                          The_Task => Robot_New.Prendre);
                        Robot_New.Modify (A_Robot,
                                          The_Box => Robot_New.Last_Box);
                        Brick_New.Modify
                           (A_Brick, The_Box => Robot_New.Box_Number (A_Robot));

                        Expertsystem.Put_Line
                           ("RegleCaser   : " & Robot_New.Name (A_Robot) &
                            " depose la brique dans la case" &
                            Integer'Image (Robot_New.Box_Number (A_Robot)));
                        Expertsystem.Put_Line (" ");

                        Robot_New.Modify (A_Robot, The_Occupation => False);
                        return True;
                    end if;
                end Regle_Caser;

            Regle_Saisir:
                --  (classe => robot,  tache => prendre)
                --  (classe => brique, lieu  => tas,   taille=> <x> )
                -- !(classe => brique, lieu  => tas,   taille=> (> <x>))
                --------------------------------------------------------
                declare
                    function Robot_Match
                                (R : Expertsystem.Reference) return Boolean is
                    begin
                        return Robot_New.Is_The_Task
                                  (Of_Robot => R,
                                   The_Task => Robot_New.Prendre) and then
                               not Robot_New.Is_Occupied (The_Robot => R);
                    end Robot_Match;

                    function Brick_Match
                                (B : Expertsystem.Reference) return Boolean is
                    begin
                        return Brick_New.Is_The_Place
                                  (Of_Brick => B,
                                   The_Place => Brick_New.Tas) and then
                               Brick_New.The_Greatest_On_Heap (Brick => B);
                    end Brick_Match;

                    function Robot_Ok is
                       new Expertsystem.Collection.Findone (Robot_Match);
                    function Brick_Ok is
                       new Expertsystem.Collection.Findone (Brick_Match);

                begin  
                    A_Brick := Brick_Ok (Brick_New.All_Bricks);
                    A_Robot := Robot_Ok (Robot_New.All_Robots);

                    if Expertsystem.Collection.Isnotnull (A_Robot) and
                       Expertsystem.Collection.Isnotnull (A_Brick) then
                        Robot_New.Modify (A_Robot, The_Occupation => True);
                        Brick_New.Modify (A_Brick,
                                          The_Place => Brick_New.Pince);
                        Robot_New.Modify (A_Robot,
                                          The_Task => Robot_New.Deposer);

                        Expertsystem.Put_Line
                           ("RegleSaisir  : " & Robot_New.Name (A_Robot) &
                            " prend brique (taille=" &
                            Integer'Image (Brick_New.Size (A_Brick)) &
                            " / couleur = " &
                            Brick_New.Tcolor'Image (Brick_New.Color (A_Brick)));
                        Expertsystem.Put_Line (" ");
                        return True;
                    end if;
                end Regle_Saisir;


            Regle_Arreter:
                --  (classe => robot, tache => prendre)
                -- !(classe => brique, lieu => tas)
                -----------------------------------------
                declare
                    function Robot_Match
                                (R : Expertsystem.Reference) return Boolean is
                    begin
                        return Robot_New.Is_The_Task
                                  (Of_Robot => R,
                                   The_Task => Robot_New.Prendre);
                    end Robot_Match;

                    function Brick_Match
                                (B : Expertsystem.Reference) return Boolean is
                    begin
                        return Brick_New.Is_The_Place
                                  (Of_Brick => B, The_Place => Brick_New.Tas);
                    end Brick_Match;

                    function Robot_Ok is
                       new Expertsystem.Collection.Findone (Robot_Match);
                    function Brick_Ok is
                       new Expertsystem.Collection.Findone (Brick_Match);

                begin
                    A_Brick := Brick_Ok (Brick_New.All_Bricks);
                    A_Robot := Robot_Ok (Robot_New.All_Robots);

                    if Expertsystem.Collection.Isnull (A_Brick) and
                       Expertsystem.Collection.Isnotnull (A_Robot) then
                        Expertsystem.Put_Line
                           ("RegleArreter : " & Robot_New.Name (A_Robot) &
                            (" se suicide (plus de briques)"));
                        Expertsystem.Put_Line (" ");

                        Robot_New.Suicide (Of_Robot => A_Robot);
                        return True;
                    end if;
                end Regle_Arreter;
            return False;
        end Peutmettreenboite;

------------------------------------------------------------------------------
        procedure Mettreenboite is
        begin
            loop
                exit when not Peutmettreenboite;
            end loop;
        end Mettreenboite;

------------------------------------------------------------------------------
        procedure Miseenboite is
        begin
            Robot_New.Create;
            Brick_New.Create;
            loop
                Mettreenboite;
                -- autres contextes a traiter
                exit;
            end loop;
        end Miseenboite;

    end Robotetbrique;


begin
    Robotetbrique.Miseenboite;
end Mise_En_Casier;