本文整理汇总了C#中Bag.GetInd方法的典型用法代码示例。如果您正苦于以下问题:C# Bag.GetInd方法的具体用法?C# Bag.GetInd怎么用?C# Bag.GetInd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bag
的用法示例。
在下文中一共展示了Bag.GetInd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestItvVsCh
//.........这里部分代码省略.........
// Stamp in1 = p[0];
// Stamp in2 = p[1];
//
// bag.push(in1);
// bag.push(in2);
}
else if (tipo <= 66)
{
// join
Debug.WriteLine("Join __________________________");
joins++;
var inda = saco.GetValidIndice();
var outa = saco.PopInd(inda);
var souta = bag.PopInd(inda);
var indb = saco.GetValidIndice();
var outb = saco.PopInd(indb);
var soutb = bag.PopInd(indb);
var novo = new CStamp();
novo.Join(outa, outb);
saco.Push(novo);
// Stamp novob = Stamp.join(souta, soutb);
// bag.push(novob);
souta.Join(soutb);
bag.Push(souta);
}
else
{
// event
Debug.WriteLine("Event _________________________");
events++;
var ind = saco.GetValidIndice();
var outStamp = saco.PopInd(ind);
outStamp.Event(gen.Gera());
saco.Push(outStamp);
var outb = bag.PopInd(ind);
// System.out.println("ANTES:"+outb.toString());
outb.MakeEvent();
// System.out.println("DPS:"+outb.toString());
bag.Push(outb);
}
var tmp = saco.GetLast();
var tmpb = bag.GetLast();
var len = saco.GetSize();
for (var n = 0;
n < len - 1;
n++)
{
var a = tmp.Equals(saco.GetInd(n));
var decd = new Stamp();
var coise = bag.GetInd(n).EncodeCharArray();
decd.Decode(coise);
// decd.dDecode(bag.getInd(n).dEncode());
var b = tmpb.Equals(decd);
// boolean b = tmpb.equals((Stamp) bag.getInd(n));
if (!((a && b) || (!a && !b)))
{
Debug.WriteLine("Devia ser " + a + ", mas e " + b + "\n\t" + tmpb + " E " + decd);
counter++;
}
}
}
// File f = new File("binaryfile");
//
// try {
// DataOutputStream out = new DataOutputStream(new FileOutputStream(f));
//
// bag.saveBag(out);
//
// out.close();
//
// DataInputStream in = new DataInputStream(new FileInputStream(f));
//
// Bag<Stamp> bbb = new Bag();
// bbb.loadBag(in);
//
//
//// System.out.print(bbb.toString());
// } catch (Exception ex) {
// ex.printStackTrace();
// }
Debug.WriteLine(" Bugs : " + counter);
Debug.WriteLine("=======================");
Debug.WriteLine(" Forks : " + forks);
Debug.WriteLine(" Joins : " + joins);
Debug.WriteLine(" Events : " + events);
Debug.WriteLine("");
Debug.WriteLine(" Bag final size : " + bag.GetSize());
}