Graphs0Test.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Created by: Christian Jacobi, September 15, 1986 11:07:56 am PDT
Last edited by: Christian Jacobi, September 29, 1986 12:34:45 pm PDT
DIRECTORY
Atom, PropertyLists, Rope, Graphs0, Graphs0Path, TerminalIO;
Graphs0Test: CEDAR PROGRAM
IMPORTS Atom, Graphs0, Graphs0Path, TerminalIO =
BEGIN
Graph: TYPE = Graphs0.Graph;
Node: TYPE = Graphs0.Node;
NodeList: TYPE = Graphs0.NodeList;
NodeSetList: TYPE = Graphs0Path.NodeSetList;
Arc: TYPE = Graphs0.Arc;
ArcList: TYPE = Graphs0.ArcList;
EnumArcProc: TYPE = Graphs0.EnumArcProc;
g: Graph;
Create: PROC [] = {
g ← Graphs0.Create[$foo];
};
Weight: Graphs0Path.ArcCostProc = {
cost ← 1
};
ArcName: PROC [arc: Arc] RETURNS [Rope.ROPE] = {
WITH arc.arcInfo SELECT FROM
r: Rope.ROPE => RETURN [r];
a: ATOM => RETURN [Atom.GetPName[a]];
ENDCASE => RETURN ["no name"];
};
DeliverArc: Graphs0.EnumArcProc = {
TerminalIO.WriteRopes["arc ", ArcName[arc], "\n"];
};
nodes: NodeList ← NIL;
nodeSetList: NodeSetList ← NIL;
effort: NAT ← 1;
random: BOOL ← FALSE;
TestPath: PROC [] = {
TerminalIO.WriteRope["TestPath\n"];
[] ← Graphs0Path.FindPath[graph: g, nodeSets: nodeSetList, arcCostProc: Weight, arcDeliverProc: DeliverArc, effort: effort, random: random];
TerminalIO.WriteRope["--\n"];
};
END.