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

⟦2204ba105⟧ Ada Source

    Length: 6144 (0x1800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Robot_New, seg_011ea8

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 Expertsystem;
use Expertsystem;

package body Robot_New is

    Current_Box_Number : Tbox := 1;
    type Struct_Robot is
        record
            His_Name : Tname;
            His_Box : Tbox;
            His_Task : Ttask;
            Is_Occupied : Boolean := False;
        end record;


    package Behavior is new Classbehavior (Struct_Robot, "ROBOTS    ", 10);

------------------------------------------------------------------------------
    function All_Robots return Collection.Object is
    begin
        return Behavior.Instances;
    end All_Robots;

------------------------------------------------------------------------------
    function Is_The_Task (Of_Robot : Robot_New.Object; The_Task : Ttask)
                         return Boolean is
    begin
        return Behavior.Get (Of_Robot).His_Task = The_Task;
    end Is_The_Task;

------------------------------------------------------------------------------
    function Is_Occupied (The_Robot : Robot_New.Object) return Boolean is
    begin
        return Behavior.Get (The_Robot).Is_Occupied;
    end Is_Occupied;

------------------------------------------------------------------------------
    function Name (Of_Robot : Robot_New.Object) return Tname is
    begin
        return Behavior.Get (Of_Robot).His_Name;
    end Name;

------------------------------------------------------------------------------
    function Box_Number (Of_Robot : Robot_New.Object) return Tbox is
    begin
        return Behavior.Get (Of_Robot).His_Box;
    end Box_Number;

------------------------------------------------------------------------------
    function Last_Box return Tbox is
    begin
        Current_Box_Number := Current_Box_Number + 1;
        return Current_Box_Number - 1;
    end Last_Box;

------------------------------------------------------------------------------
    procedure Modify (The_Robot : Robot_New.Object; The_Occupation : Boolean) is
        A_Robot : Struct_Robot;
    begin
        A_Robot := Behavior.Get (The_Robot);
        A_Robot.Is_Occupied := The_Occupation;
        Behavior.Set (The_Robot, A_Robot);
    end Modify;

------------------------------------------------------------------------------
    procedure Modify (The_Robot : Robot_New.Object; The_Task : Ttask) is
        A_Robot : Struct_Robot;
    begin
        A_Robot := Behavior.Get (The_Robot);
        A_Robot.His_Task := The_Task;
        Behavior.Set (The_Robot, A_Robot);
    end Modify;

------------------------------------------------------------------------------
    procedure Modify (The_Robot : Robot_New.Object; The_Box : Tbox) is
        A_Robot : Struct_Robot;
    begin
        A_Robot := Behavior.Get (The_Robot);
        A_Robot.His_Box := The_Box;
        Behavior.Set (The_Robot, A_Robot);
    end Modify;

------------------------------------------------------------------------------
    procedure Suicide (Of_Robot : Robot_New.Object) is
    begin
        Behavior.Dispose (Of_Robot);
    end Suicide;



------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
    procedure Create is
    begin
        Behavior.Allocate (Struct_Robot'("Robot No 1", 1, Prendre, False));
        Behavior.Allocate (Struct_Robot'("Robot No 2", 1, Prendre, False));
        Put (" Nb robots : ");
        Put (Behavior.Cardinality);
        Put_Line (" ");
    end Create;

end Robot_New;

-------------------------------------------------------------------------------
--                      DESCRIPTION  DES  REGLES                             --
-------------------------------------------------------------------------------


E3 Meta Data

    nblk1=5
    nid=3
    hdr6=8
        [0x00] rec0=21 rec1=00 rec2=01 rec3=022
        [0x01] rec0=19 rec1=00 rec2=04 rec3=080
        [0x02] rec0=1b rec1=00 rec2=05 rec3=006
        [0x03] rec0=19 rec1=00 rec2=02 rec3=000
        [0x04] rec0=18 rec1=00 rec2=03 rec3=001
    tail 0x2150d342082466d131875 0x42a00088462060003
Free Block Chain:
  0x3: 0000  00 00 03 7e 00 24 20 20 20 20 20 20 20 20 42 65  ┆   ~ $        Be┆