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.