"justify"> createItems (
int itemsNum, ItemTemplate it,
int maxVolume,
int maxWeight) {
int volumeDiapasonLength=maxVolume - it. getVolume (). getBegin ();
int weightDiapasonLength=maxWeight - it. getWeight (). getBegin ();
int r1DiapasonLength=it. getRate1 (). getEnd () - it. getRate1 (). getBegin ();
int r2DiapasonLength=it. getRate2 (). getEnd () - it. getRate2 (). getBegin ();
int r3DiapasonLength=it. getRate3 (). getEnd () - it. getRate3 (). getBegin ();
int r4DiapasonLength=it. getRate4 (). getEnd () - it. getRate4 (). getBegin ();
int r5DiapasonLength=it. getRate5 (). getEnd () - it. getRate5 (). getBegin ();
for ( int i=0; i lt; itemsNum; i ++) {. add ( new Item (i + raquo ;, r. nextInt (volumeDiapasonLength + 1) + it. getVolume (). getBegin () ,. nextInt (weightDiapasonLength + 1) + it. getWeight (). getBegin () ,. nextInt (r1DiapasonLength + 1) + it. getRate1 (). getBegin () ,. nextInt (r2DiapasonLength + 1) + it. getRate2 (). getBegin () ,. nextInt ( r3DiapasonLength + 1) + it. getRate3 (). getBegin () ,. nextInt (r4DiapasonLength + 1) + it. getRate4 (). getBegin () ,. nextInt (r5DiapasonLength + 1) + it. getRate5 (). getBegin () ));
}
}
/**
* @ return the containers
*/
public List lt; Container gt; getContainers () {
return containers;
}
/**
* @ return the items
*/
public List lt; Item gt; getItemsClones () { lt; SimpleEntry lt; String, String gt; gt; itemPairs= new ArrayList lt; SimpleEntry lt; String, String gt; gt; (); lt; Item gt; newItems= new ArrayList lt; Item gt; ();
for (Item i: items) {. add (i. clone ());
if (i. hasPair ()) {. add ( new SimpleEntry lt; String, String gt; (i. getId (), i. getPair (). getId ()));
}
}
for (Entry lt; String, String gt; e: itemPairs) {(e. getKey (), newItems). setPair (getItemFromListByID (e. getValue (), newItems));
}
return newItems;
}
public List lt; Item gt; getItemsInstance () {
return items;
}
public void setEmpty () {. clear () ;. clear ();
}
/**
* @ return the paretoSet
*/
public List lt; List lt; Item gt; gt; getParetoSetInstance () {
return paretoSet;
}
/**
* @ return the paretoSet
*/
public List lt; List lt; Item gt; gt; getParetoSetClone () { lt; List lt; Item gt; gt; clone= new ArrayList lt; List lt; Item gt; gt; (); lt; SimpleEntry lt; String, String gt; gt; itemPairs= new ArrayList lt; SimpleEntry lt; String, String gt; gt; ();
for (List lt; Item gt; paretoLayer: paretoSet) { lt; Item gt; newParetoLayer= new ArrayList lt; Item gt; ();
for (Item i: paretoLayer) {. add (i. clone ());
if (i. hasPair ()) {. add ( new SimpleEntry lt; String, String gt; (i. getId (), i. getPair (). getId ()));
}
}. add (newParetoLayer);
}
for (Entry lt; String, String gt; e: itemPairs) {(e. getKey (), clone). setPair (getItemFromParetoSetByID (e. getValue (), clone));
}