|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 4022 (0xfb6)
Types: TextFile
Names: »B«
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
└─⟦129cab021⟧ »DATA«
└─⟦this⟧
with Text_Io;
package body Etape is
package Int_Io is new Text_Io.Integer_Io (Num => Integer);
-- fonction privee : retourne l'etape suivante de l' etape courante de la liste etape
function Etape_Suivante (E_Consultee : in P_Etape) return P_Etape is
begin
return E_Consultee.Suivant;
end Etape_Suivante;
-- fonction privee : echange l'action d'une etape avec une autre action
procedure Echange_Action (E_Modifiee : in out P_Etape;
Nouvelle_Action : in Action) is
begin
E_Modifiee.L_Action := Nouvelle_Action;
end Echange_Action;
-- fin des fonctions privees d'etape
-- fonction publique : creee une nouvelle cellule etape
function Creer_Etape (Temps_E : in Temps;
Action_E : in Action;
E_Suivante : in P_Etape) return P_Etape is
Result : P_Etape;
begin
Result := new Cell_Etape;
Result.Le_Temps := Temps_E;
Result.L_Action := Action_E;
Result.Suivant := E_Suivante;
return Result;
end Creer_Etape;
-- fonction publique : retourne le temps de l'etape
function Temps_Etape (E_Consultee : in P_Etape) return Temps is
begin
return E_Consultee.Le_Temps;
end Temps_Etape;
-- fonction publique : retourne true si l'etape est vide sinon retourne false
function Etape_Est_Vide (E_Consultee : in P_Etape) return Boolean is
begin
return E_Consultee = Etape_Vide;
end Etape_Est_Vide;
-- procedure publique : insere une etape dans la liste des etapes
-- en classant celle-ci suivant son temps
procedure Ajouter_Etape (E_Modifiee : in out P_Etape;
Temps_E : in Temps;
Action_E : in Action) is
Tmp1 : P_Etape;
begin
if (Etape_Est_Vide (E_Consultee => E_Modifiee)) then
E_Modifiee := Creer_Etape (Temps_E => Temps_E,
Action_E => Action_E,
E_Suivante => Etape_Vide);
else
if (Temps_E = Temps_Etape (E_Consultee => E_Modifiee)) then
Echange_Action (E_Modifiee => E_Modifiee,
Nouvelle_Action => Action_E);
else
if (Temps_E > Temps_Etape (E_Consultee => E_Modifiee)) then
Tmp1 := Etape_Suivante (E_Consultee => E_Modifiee);
Ajouter_Etape (E_Modifiee => Tmp1,
Temps_E => Temps_E,
Action_E => Action_E);
E_Modifiee.Suivant := Tmp1;
else
E_Modifiee := Creer_Etape (Temps_E => Temps_E,
Action_E => Action_E,
E_Suivante => E_Modifiee);
end if;
end if;
end if;
end Ajouter_Etape;
-- procedure publique : affiche l'integralite des informations contenues dans la liste etape
procedure Affiche_Etape (E_Affichee : in P_Etape) is
Tmp : P_Etape;
Continu : Boolean := True;
begin
Tmp := E_Affichee;
while (Continu) loop
Text_Io.Put_Line ("");
Text_Io.Put ("le temps :");
Int_Io.Put (Tmp.Le_Temps);
Text_Io.Put (" l'action la valeur: ");
Int_Io.Put (Tmp.L_Action.La_Valeur);
if (Tmp.L_Action.La_Transition = 0) then
Text_Io.Put (" il n'y a pas de transition");
else
Text_Io.Put (" la transition : ");
Int_Io.Put (Tmp.L_Action.La_Transition);
end if;
Tmp := Etape_Suivante (E_Consultee => Tmp);
if (Etape_Est_Vide (E_Consultee => Tmp)) then
Continu := False;
end if;
end loop;
Text_Io.Put_Line ("");
end Affiche_Etape;
end Etape;