--File: PlaceCompsTest.mesa
-- Last Edited by: CSChow, February 2, 1985 2:39:20 am PST
DIRECTORY
Real,
Rope,
List,
TerminalIO,
OrderedRefArray,
IPCoTab,
IPTop,
IPChWidthEst,
IPMainViewer,
IPPlaceProcs,
IPPlaceKit,
IPPlaceXamples,
IPPlaceBinPack;
--Intro: The whole purpose of this module is to use of simple names in place of
-- a series of procedures.
PlaceCompsTest: CEDAR PROGRAM
IMPORTS List, OrderedRefArray, IPCoTab, IPMainViewer, IPPlaceProcs, IPPlaceKit, IPPlaceXamples, IPPlaceBinPack
= BEGIN
--Test.A
A1: PROC[breadth, keep: INT, compList: LIST OF REF] = {
coTab: IPCoTab.Ref ← IPMainViewer.MVTop.coTab;
comps: LIST OF IPCoTab.Component ← NIL;
compList ← List.Reverse[compList];
UNTIL compList = NIL DO
comps ← CONS[IPCoTab.GetComponent[coTab, NARROW[compList.first]], comps];
compList ← compList.rest;
ENDLOOP;
IPMainViewer.TrialSolutions ← OrderedRefArray.Create[keep];
IPPlaceProcs.PlaceComps[IPMainViewer.MVTop, comps, IPPlaceXamples.PlaceCompTGenX1, IPPlaceXamples.PlaceEvaluatorX1, IPMainViewer.TrialSolutions];
}; --TestA
--Test.B
A2: PROC[breadth, keep: INT, compList: LIST OF REF] = {
coTab: IPCoTab.Ref ← IPMainViewer.MVTop.coTab;
comps: LIST OF IPCoTab.Component ← NIL;
compList ← List.Reverse[compList];
UNTIL compList = NIL DO
comps ← CONS[IPCoTab.GetComponent[coTab, NARROW[compList.first]], comps];
compList ← compList.rest;
ENDLOOP;
IPMainViewer.TrialSolutions ← OrderedRefArray.Create[keep];
IPPlaceProcs.PlaceComps[IPMainViewer.MVTop, comps, IPPlaceXamples.PlaceCompTGenX1, IPPlaceXamples.PlaceEvaluatorX2, IPMainViewer.TrialSolutions];
}; --A2
B1: PROC[keep: NAT] ={
IPMainViewer.TrialSolutions ← OrderedRefArray.Create[keep];
IPPlaceProcs.PlaceInit[IPMainViewer.MVTop, IPPlaceXamples.OrderingFnX1, IPPlaceXamples.PlaceCompTGenX1, IPPlaceXamples.PlaceEvaluatorX1, IPMainViewer.TrialSolutions]
};--B1
B2: PROC[keep: NAT] ={
IPMainViewer.TrialSolutions ← OrderedRefArray.Create[keep];
IPPlaceProcs.PlaceInit[IPMainViewer.MVTop, IPPlaceXamples.OrderingFnX1, IPPlaceXamples.PlaceCompTGenX2, IPPlaceXamples.PlaceEvaluatorX2, IPMainViewer.TrialSolutions]
};--B2
C1: PROC[numb, keep: NAT] ={
IPMainViewer.TrialSolutions ← OrderedRefArray.Create[keep];
IPPlaceProcs.RemoveComps[IPMainViewer.MVTop, numb, IPPlaceXamples.RemoveCompsTGenX1, IPPlaceXamples.RemoveEvaluatorX1, IPMainViewer.TrialSolutions]
}; --C1
D1: PROC[remove, numbOfTrials, keep: NAT] ={
IPMainViewer.TrialSolutions ← OrderedRefArray.Create[keep];
IPPlaceProcs.PlaceImprove[IPMainViewer.MVTop, remove, numbOfTrials, IPPlaceXamples.RemoveCompsTGenX1, IPPlaceXamples.RemoveEvaluatorX1, IPPlaceXamples.PlaceCompTGenX2, IPPlaceXamples.PlaceEvaluatorX2, IPMainViewer.TrialSolutions]
}; --D1
E: PROC[comp: Rope.ROPE, refVer: BOOL, keep: NAT, keepInit: BOOL] ={
IPMainViewer.TrialSolutions ← OrderedRefArray.Create[keep];
IPPlaceKit.CompactComp0[IPMainViewer.MVTop, IPCoTab.GetComponent[IPMainViewer.MVTop.coTab, comp], (IF refVer THEN ver ELSE hor), IPPlaceBinPack.PlaceEvaluator1, IPMainViewer.TrialSolutions, 0, keepInit];
};
F1: PROC[keep: NAT] ={
IPMainViewer.TrialSolutions ← OrderedRefArray.Create[keep];
IPPlaceProcs.PlaceInit[IPMainViewer.MVTop, IPPlaceBinPack.OrderingFn1, IPPlaceBinPack.PlaceCompTGen1, IPPlaceBinPack.PlaceEvaluator1, IPMainViewer.TrialSolutions]
};--F1
F2: PROC[keep: NAT] ={
IPMainViewer.TrialSolutions ← OrderedRefArray.Create[keep];
IPPlaceProcs.PlaceInit[IPMainViewer.MVTop, IPPlaceBinPack.OrderingFn1, IPPlaceBinPack.PlaceCompTGen1, IPPlaceBinPack.PlaceEvaluator2, IPMainViewer.TrialSolutions]
};--F2
G1: PROC[breadth, keep: INT, compList: LIST OF REF] = {
coTab: IPCoTab.Ref ← IPMainViewer.MVTop.coTab;
comps: LIST OF IPCoTab.Component ← NIL;
compList ← List.Reverse[compList];
UNTIL compList = NIL DO
comps ← CONS[IPCoTab.GetComponent[coTab, NARROW[compList.first]], comps];
compList ← compList.rest;
ENDLOOP;
IPMainViewer.TrialSolutions ← OrderedRefArray.Create[keep];
IPPlaceProcs.PlaceComps[IPMainViewer.MVTop, comps, IPPlaceBinPack.PlaceCompTGen1, IPPlaceBinPack.PlaceEvaluator1, IPMainViewer.TrialSolutions];
}; --G1
H1: PROC[keep: NAT] ={
IPMainViewer.TrialSolutions ← OrderedRefArray.Create[keep];
IPPlaceProcs.PlaceInit[IPMainViewer.MVTop, IPPlaceBinPack.OrderingFn1, IPPlaceBinPack.PlaceCompTGen1, IPPlaceBinPack.PlaceEvaluator1, IPMainViewer.TrialSolutions]
};--H1
H2: PROC[keep: NAT] ={
IPMainViewer.TrialSolutions ← OrderedRefArray.Create[keep];
IPPlaceProcs.PlaceInit[IPMainViewer.MVTop, IPPlaceBinPack.OrderingFn1, IPPlaceBinPack.PlaceCompTGen1, IPPlaceBinPack.PlaceEvaluator2, IPMainViewer.TrialSolutions]
};--H2
J1: PROC[depth, keep: NAT] ={
IPMainViewer.TrialSolutions ← OrderedRefArray.Create[keep];
IPPlaceKit.FTPerturbTop[IPMainViewer.MVTop, IPPlaceBinPack.PlaceEvaluator1, depth, IPMainViewer.TrialSolutions, 0]
}; --J1
END.