public override bool generate(World world, Random random, int i, int j, int k) { worldObj = world; long l = random.nextLong(); field_759_b.setSeed(l); basePos[0] = i; basePos[1] = j; basePos[2] = k; if (field_756_e == 0) { field_756_e = 5 + field_759_b.nextInt(field_748_m); } if (!func_422_e()) { return false; } else { func_424_a(); func_421_b(); func_432_c(); func_428_d(); return true; } }
public override bool generate(World world, java.util.Random random, int i, int j, int k) { if (BlockData.BlockMaterial(world.GetBlock(i, j, k)) != Material.Water) { return(false); } int l = random.nextInt(numberOfBlocks - 2) + 2; int i1 = 1; for (int j1 = i - l; j1 <= i + l; j1++) { for (int k1 = k - l; k1 <= k + l; k1++) { int l1 = j1 - i; int i2 = k1 - k; if (l1 * l1 + i2 * i2 > l * l) { continue; } for (int j2 = j - i1; j2 <= j + i1; j2++) { int k2 = world.GetBlock(j1, j2, k1); if (k2 == (byte)Blocks.Dirt || k2 == (byte)Blocks.ClayBlock) { world.SetBlock(j1, j2, k1, (byte)clayBlockId); } } } } return(true); }
public override bool generate(World world, java.util.Random random, int i, int j, int k) { if (BlockData.BlockMaterial(world.GetBlock(i, j, k)) != Material.Water) { return(false); } int l = random.nextInt(field_35290_b - 2) + 2; byte byte0 = 2; for (int i1 = i - l; i1 <= i + l; i1++) { for (int j1 = k - l; j1 <= k + l; j1++) { int k1 = i1 - i; int l1 = j1 - k; if (k1 * k1 + l1 * l1 > l * l) { continue; } for (int i2 = j - byte0; i2 <= j + byte0; i2++) { int j2 = world.GetBlock(i1, i2, j1); if (j2 == (byte)Blocks.Dirt || j2 == (byte)Blocks.Grass) { world.SetBlock(i1, i2, j1, (byte)field_35291_a); } } } } return(true); }
public virtual void testEnvelope2000() { com.esri.core.geometry.Point[] points = new com.esri.core.geometry.Point[2000]; java.util.Random random = new java.util.Random(69); for (int i = 0; i < 2000; i++) { points[i] = new com.esri.core.geometry.Point(); points[i].setX(random.nextDouble() * 100); points[i].setY(random.nextDouble() * 100); } for (int iter = 0; iter < 2; iter++) { long startTime = Sharpen.Runtime.nanoTime(); com.esri.core.geometry.Envelope geomExtent = new com.esri.core.geometry.Envelope( ); com.esri.core.geometry.Envelope fullExtent = new com.esri.core.geometry.Envelope( ); for (int i_1 = 0; i_1 < 2000; i_1++) { points[i_1].queryEnvelope(geomExtent); fullExtent.merge(geomExtent); } long endTime = Sharpen.Runtime.nanoTime(); } }
public override bool generate(World world, java.util.Random random, int i, int j, int k) { if (world.GetBlock(i, j + 1, k) != (byte)Blocks.Stone) { return(false); } if (world.GetBlock(i, j - 1, k) != (byte)Blocks.Stone) { return(false); } if (world.GetBlock(i, j, k) != 0 && world.GetBlock(i, j, k) != (byte)Blocks.Stone) { return(false); } int l = 0; if (world.GetBlock(i - 1, j, k) == (byte)Blocks.Stone) { l++; } if (world.GetBlock(i + 1, j, k) == (byte)Blocks.Stone) { l++; } if (world.GetBlock(i, j, k - 1) == (byte)Blocks.Stone) { l++; } if (world.GetBlock(i, j, k + 1) == (byte)Blocks.Stone) { l++; } int i1 = 0; if (world.IsAirBlock(i - 1, j, k)) { i1++; } if (world.IsAirBlock(i + 1, j, k)) { i1++; } if (world.IsAirBlock(i, j, k - 1)) { i1++; } if (world.IsAirBlock(i, j, k + 1)) { i1++; } if (l == 3 && i1 == 1) { world.SetBlock(i, j, k, (byte)liquidBlockId); world.physics.AddCheck(i, j, k, true); //world.scheduledUpdatesAreImmediate = true; //Block.blocksList[liquidBlockId].updateTick(world, i, j, k, random); //world.scheduledUpdatesAreImmediate = false; } return(true); }
public override bool generate(World world, Random random, int i, int j, int k) { worldObj = world; long l = random.nextLong(); field_759_b.setSeed(l); basePos[0] = i; basePos[1] = j; basePos[2] = k; if (field_756_e == 0) { field_756_e = 5 + field_759_b.nextInt(field_748_m); } if (!func_422_e()) { return(false); } else { func_424_a(); func_421_b(); func_432_c(); func_428_d(); return(true); } }
private int pickMobSpawner(java.util.Random random) { int i = random.nextInt(4); if (i == 0) { return((int)MobType.Skeleton); } if (i == 1) { return((int)MobType.Zombie); } if (i == 2) { return((int)MobType.Zombie); } if (i == 3) { return((int)MobType.Spider); } else { return(0); } }
public override bool generate(World world, java.util.Random random, int i, int j, int k) { worldObj = world; long l = random.nextLong(); random0.setSeed(l); basePos[0] = i; basePos[1] = j; basePos[2] = k; if (heightLimit == 0) { heightLimit = 5 + random0.nextInt(heightLimitLimit); } if (!validTreeLocation()) { return(false); } else { generateLeafNodeList(); generateLeaves(); generateTrunk(); generateLeafNodeBases(); return(true); } }
public NoiseGeneratorOctaves(java.util.Random random, int i) { octaves = i; generatorCollection = new NoiseGeneratorPerlin[i]; for (int j = 0; j < i; j++) { generatorCollection[j] = new NoiseGeneratorPerlin(random); } }
public virtual WorldGenerator getRandomWorldGenForTrees(java.util.Random random) { if (random.nextInt(10) == 0) { return(bigTreeGenerator); } else { return(treeGenerator); } }
public override WorldGenerator getRandomWorldGenForTrees(java.util.Random random) { if (random.nextInt(3) == 0) { return(new WorldGenTaiga1()); } else { return(new WorldGenTaiga2(false)); } }
private Item pickCheckLootItem(java.util.Random random) { int i = random.nextInt(11); if (i == 0) { return(new Item((short)Items.Saddle)); } if (i == 1) { return(new Item((short)Items.IronIngot, (byte)(random.nextInt(4) + 1))); } if (i == 2) { return(new Item((short)Items.Bread)); } if (i == 3) { return(new Item((short)Items.Wheat, (byte)(random.nextInt(4) + 1))); } if (i == 4) { return(new Item((short)Items.Gunpowder, (byte)(random.nextInt(4) + 1))); } if (i == 5) { return(new Item((short)Items.String, (byte)(random.nextInt(4) + 1))); } if (i == 6) { return(new Item((short)Items.Bucket)); } if (i == 7 && random.nextInt(100) == 0) { return(new Item((short)Items.AppleGolden)); } if (i == 8 && random.nextInt(2) == 0) { return(new Item((short)Items.Redstone, (byte)(random.nextInt(4) + 1))); } if (i == 9 && random.nextInt(10) == 0) { return(new Item((short)((short)Items.GreenMusicDisc + random.nextInt(2)))); } if (i == 10) { return(new Item((short)Items.Dye, 1, 3)); } else { return(null); } }
public override bool generate(World world, java.util.Random random, int i, int j, int k) { float f = random.nextFloat() * 3.141593F; double d = (float)(i + 8) + (MathHelper.sin(f) * (float)numberOfBlocks) / 8F; double d1 = (float)(i + 8) - (MathHelper.sin(f) * (float)numberOfBlocks) / 8F; double d2 = (float)(k + 8) + (MathHelper.cos(f) * (float)numberOfBlocks) / 8F; double d3 = (float)(k + 8) - (MathHelper.cos(f) * (float)numberOfBlocks) / 8F; double d4 = (j + random.nextInt(3)) - 2; double d5 = (j + random.nextInt(3)) - 2; for (int l = 0; l <= numberOfBlocks; l++) { double d6 = d + ((d1 - d) * (double)l) / (double)numberOfBlocks; double d7 = d4 + ((d5 - d4) * (double)l) / (double)numberOfBlocks; double d8 = d2 + ((d3 - d2) * (double)l) / (double)numberOfBlocks; double d9 = (random.nextDouble() * (double)numberOfBlocks) / 16D; double d10 = (double)(MathHelper.sin(((float)l * 3.141593F) / (float)numberOfBlocks) + 1.0F) * d9 + 1.0D; double d11 = (double)(MathHelper.sin(((float)l * 3.141593F) / (float)numberOfBlocks) + 1.0F) * d9 + 1.0D; int i1 = MathHelper.floor_double(d6 - d10 / 2D); int j1 = MathHelper.floor_double(d7 - d11 / 2D); int k1 = MathHelper.floor_double(d8 - d10 / 2D); int l1 = MathHelper.floor_double(d6 + d10 / 2D); int i2 = MathHelper.floor_double(d7 + d11 / 2D); int j2 = MathHelper.floor_double(d8 + d10 / 2D); for (int k2 = i1; k2 <= l1; k2++) { double d12 = (((double)k2 + 0.5D) - d6) / (d10 / 2D); if (d12 * d12 >= 1.0D) { continue; } for (int l2 = j1; l2 <= i2; l2++) { double d13 = (((double)l2 + 0.5D) - d7) / (d11 / 2D); if (d12 * d12 + d13 * d13 >= 1.0D) { continue; } for (int i3 = k1; i3 <= j2; i3++) { double d14 = (((double)i3 + 0.5D) - d8) / (d10 / 2D); if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && world.GetBlock(k2, l2, i3) == (byte)Blocks.Stone) { world.SetBlock(k2, l2, i3, (byte)minableBlockId); } } } } } return(true); }
public WorldGenBigTree() { field_759_b = new Random(); field_756_e = 0; field_754_g = 0.61799999999999999D; field_753_h = 1.0D; field_752_i = 0.38100000000000001D; field_751_j = 1.0D; field_750_k = 1.0D; field_749_l = 1; field_748_m = 12; field_747_n = 4; }
public Maze(long paramLong, int w, int h) { java.util.Random localRandom = new java.util.Random(paramLong); this.iteration = 0; this.diagonal = false; this.n_directions = 4; //this.cde = new Key.Key_comparator(); //this.u = new TreeSet(this.cde); this.u = new BinaryHeap(w * h); this.size_x = w; this.size_y = h; this.cells = new Node[w, h]; for (int ii = 0; ii < w; ii++) { for (int jj = 0; jj < h; jj++) { this.cells[ii, jj] = new Node(ii, jj); } } int i = (int)(localRandom.nextDouble() * 2147483647.0D) % w; int j = (int)(localRandom.nextDouble() * 2147483647.0D) % h; this.original_start = (this.robot_cell = this.start = this.cells[i, j]); do { i = (int)(localRandom.nextDouble() * 2147483647.0D) % w; j = (int)(localRandom.nextDouble() * 2147483647.0D) % h; this.goal = this.cells[i, j]; } while ((this.start.X == this.goal.X) && (this.start.Y == this.goal.Y)); for (i = 0; i < w; i++) { for (j = 0; j < h; j++) { this.cells[i, j].h = (Math.Abs(i - this.goal.X) + Math.Abs(j - this.goal.Y)); this.cells[i, j].iteration = this.iteration; if ((this.cells[i, j] == this.start) || (this.cells[i, j] == this.goal) || (localRandom.nextDouble() > 0.25D)) { continue; } this.cells[i, j].real_type = 1; } } }
// View-Based Classification public static void ViewBasedClassification(Instances insts, int folds, int view, int k) { java.util.Random rand = new java.util.Random(1); insts.setClassIndex(insts.numAttributes() - 1); Vote vote = new Vote(); Classifier[] classifiers = new Classifier[k]; for (int i = 1; i <= k; i++) { IBk IBk = new IBk(); // Instance-based (IB) learner IBk.setKNN(i); classifiers[i - 1] = IBk; } vote.setClassifiers(classifiers); vote.setCombinationRule(new SelectedTag(Vote.MAJORITY_VOTING_RULE, Vote.TAGS_RULES)); vote.buildClassifier(insts); // Generate classifiers AbstractOutput output = new PlainText(); output.setBuffer(new java.lang.StringBuffer()); output.setHeader(insts); Evaluation evaluation = new Evaluation(insts); evaluation.crossValidateModel(vote, insts, folds, rand, output); // n-fold cross validation // Parse the output string string str = output.getBuffer().toString(); str = str.Replace(" ", " ").Replace(" ", " ").Replace(" ", " ").Replace(" ", " "); string[] line = str.Split('\n'); predicted[view] = new List <int>(); predicted[view].Clear(); actual.Clear(); for (int i = 1; i < line.Length - 1; i++) { String[] linesplit = line[i].Trim().Split(' '); int index = linesplit[1].IndexOf(':'); // Actual class actual.Add(Convert.ToInt16(linesplit[1].Substring(0, index)) - 1); index = linesplit[2].IndexOf(':'); // Predicted class predicted[view].Add(Convert.ToInt16(linesplit[2].Substring(0, index)) - 1); } }
public WorldGenBigTree(bool flag) : base(flag) { random0 = new java.util.Random(); heightLimit = 0; heightAttenuation = 0.61799999999999999D; field_753_h = 1.0D; field_752_i = 0.38100000000000001D; field_751_j = 1.0D; field_750_k = 1.0D; trunkSize = 1; heightLimitLimit = 12; leafDistanceLimit = 4; }
/// <summary>Builds an Ogg Speex Writer.</summary> /// <remarks>Builds an Ogg Speex Writer.</remarks> public OggSpeexWriter() { if (streamSerialNumber == 0) { streamSerialNumber = new java.util.Random().nextInt(); } dataBuffer = new byte[65565]; dataBufferPtr = 0; headerBuffer = new byte[255]; headerBufferPtr = 0; pageCount = 0; packetCount = 0; granulepos = 0; }
public override bool generate(World world, java.util.Random random, int i, int j, int k) { for (int l = 0; l < 64; l++) { int i1 = (i + random.nextInt(8)) - random.nextInt(8); int j1 = (j + random.nextInt(4)) - random.nextInt(4); int k1 = (k + random.nextInt(8)) - random.nextInt(8); if (world.IsAirBlock(i1, j1, k1) && world.GetBlock(i1, j1 - 1, k1) == (byte)Blocks.Netherrack) { world.SetBlock(i1, j1, k1, (byte)Blocks.Fire); } } return(true); }
public override WorldGenerator getRandomWorldGenForTrees(java.util.Random random) { if (random.nextInt(5) == 0) { return(forestGenerator); } if (random.nextInt(10) == 0) { return(bigTreeGenerator); } else { return(treeGenerator); } }
public override bool generate(World world, java.util.Random random, int i, int j, int k) { for (int l = 0; l < 10; l++) { int i1 = (i + random.nextInt(8)) - random.nextInt(8); int j1 = (j + random.nextInt(4)) - random.nextInt(4); int k1 = (k + random.nextInt(8)) - random.nextInt(8); if (world.IsAirBlock(i1, j1, k1) && world.CanPlaceAt((byte)Blocks.LilyPad, i1, j1, k1)) { world.SetBlock(i1, j1, k1, (byte)Blocks.LilyPad); } } return(true); }
private static void func_35311_a(java.util.Random random, StructurePieceTreasure[] astructurepiecetreasure, ContainerChest tileentitychest, int i) { for (int j = 0; j < i; j++) { StructurePieceTreasure structurepiecetreasure = (StructurePieceTreasure)WeightedRandom.func_35691_a(random, astructurepiecetreasure); int k = structurepiecetreasure.field_35488_c + random.nextInt((structurepiecetreasure.field_35486_e - structurepiecetreasure.field_35488_c) + 1); if (Inventory.isStackable((short)structurepiecetreasure.field_35489_a) >= k) { tileentitychest.SetSlot(random.nextInt(tileentitychest.Size), new Item((short)structurepiecetreasure.field_35489_a, (byte)k, (short)structurepiecetreasure.field_35487_b)); continue; } for (int l = 0; l < k; l++) { tileentitychest.SetSlot(random.nextInt(tileentitychest.Size), new Item((short)structurepiecetreasure.field_35489_a, 1, (short)structurepiecetreasure.field_35487_b)); } } }
public void generateStructure(World world, java.util.Random random, StructureBoundingBox structureboundingbox) { IEnumerator <StructureComponent> iterator = new LinkedList <StructureComponent>(components).GetEnumerator(); do { if (!iterator.MoveNext()) { break; } StructureComponent structurecomponent = (StructureComponent)iterator.Current; if (structurecomponent.getStructureBoundingBox().canFitInside(structureboundingbox) && !structurecomponent.addComponentParts(world, random, structureboundingbox)) { components.Remove(iterator.Current); } } while (true); }
public override bool generate(World world, java.util.Random random, int i, int j, int k) { if (!world.IsAirBlock(i, j, k) || world.GetBlock(i, j - 1, k) != field_40207_a) { return(false); } int l = random.nextInt(32) + 6; int i1 = random.nextInt(4) + 1; for (int j1 = i - i1; j1 <= i + i1; j1++) { for (int l1 = k - i1; l1 <= k + i1; l1++) { int j2 = j1 - i; int l2 = l1 - k; if (j2 * j2 + l2 * l2 <= i1 * i1 + 1 && world.GetBlock(j1, j - 1, l1) != field_40207_a) { return(false); } } } for (int k1 = j; k1 < j + l && k1 < world.worldYMax; k1++) { for (int i2 = i - i1; i2 <= i + i1; i2++) { for (int k2 = k - i1; k2 <= k + i1; k2++) { int i3 = i2 - i; int j3 = k2 - k; if (i3 * i3 + j3 * j3 <= i1 * i1 + 1) { world.SetBlock(i2, k1, k2, (byte)Blocks.Obsidian); } } } } // TODO /*EntityEnderCrystal entityendercrystal = new EntityEnderCrystal(world); * entityendercrystal.setLocationAndAngles((float)i + 0.5F, j + l, (float)k + 0.5F, random.nextFloat() * 360F, 0.0F); * world.entityJoinedWorld(entityendercrystal);*/ world.SetBlock(i, j + l, k, (byte)Blocks.Bedrock); return(true); }
public override bool generate(World world, java.util.Random random, int i, int j, int k) { for (int l = 0; ((l = world.GetBlock(i, j, k)) == 0 || l == (byte)Blocks.Leaves) && j > 0; j--) { } for (int i1 = 0; i1 < 4; i1++) { int j1 = (i + random.nextInt(8)) - random.nextInt(8); int k1 = (j + random.nextInt(4)) - random.nextInt(4); int l1 = (k + random.nextInt(8)) - random.nextInt(8); if (world.IsAirBlock(j1, k1, l1) && world.CanBlockStay((byte)field_28055_a, j1, k1, l1)) { world.SetBlock(j1, k1, l1, (byte)field_28055_a); } } return(true); }
public void Decorates(World world, java.util.Random random, int i, int j) { if (curWorldObj != null) { throw new Exception("Already decorating!!"); } else { curWorldObj = world; randomGenerator = random; chunk_X = i; chunk_Z = j; func_35256_b(); curWorldObj = null; randomGenerator = null; return; } }
public virtual void generate(World world, int i, int j, byte[] abyte0) { int k = field_947_a; field_35530_d = world; rand = new java.util.Random(world.seed); long l = rand.nextLong(); long l1 = rand.nextLong(); for(int i1 = i - k; i1 <= i + k; i1++) { for(int j1 = j - k; j1 <= j + k; j1++) { long l2 = (long)i1 * l; long l3 = (long)j1 * l1; rand = new java.util.Random(l2 ^ l3 ^ world.seed); recursiveGenerate(world, i1, j1, i, j, abyte0); } } }
protected void func_35545_a(World world, java.util.Random random, int i) { int j = world.worldOceanHeight - i; int k = boundingBox.bbHeight() + 1; if (k < j) { k += random.nextInt(j - k); } int l = k - boundingBox.y2; boundingBox.offset(0, l, 0); StructureComponent structurecomponent; for (IEnumerator <StructureComponent> iterator = components.GetEnumerator(); iterator.MoveNext(); structurecomponent.getStructureBoundingBox().offset(0, l, 0)) { structurecomponent = (StructureComponent)iterator.Current; } }
public NoiseGeneratorPerlin(java.util.Random random) { permutations = new int[512]; xCoord = random.nextDouble() * 256D; yCoord = random.nextDouble() * 256D; zCoord = random.nextDouble() * 256D; for (int i = 0; i < 256; i++) { permutations[i] = i; } for (int j = 0; j < 256; j++) { int k = random.nextInt(256 - j) + j; int l = permutations[j]; permutations[j] = permutations[k]; permutations[k] = l; permutations[j + 256] = permutations[j]; } }
public virtual void generate(World world, int i, int j, byte[] abyte0) { int k = field_947_a; field_35530_d = world; rand = new java.util.Random(world.seed); long l = rand.nextLong(); long l1 = rand.nextLong(); for (int i1 = i - k; i1 <= i + k; i1++) { for (int j1 = j - k; j1 <= j + k; j1++) { long l2 = (long)i1 * l; long l3 = (long)j1 * l1; rand = new java.util.Random(l2 ^ l3 ^ world.seed); recursiveGenerate(world, i1, j1, i, j, abyte0); } } }
public GenStandard(World w, bool flag) { worldObj = w; random = new java.util.Random(w.seed); stoneNoise = new double[256]; caveGenerator = new MapGenCaves(); //strongholdGenerator = new MapGenStronghold(); //villageGenerator = new MapGenVillage(); //mineshaftGenerator = new MapGenMineshaft(); ravineGenerator = new MapGenRavine(); //unusedIntArray32x32 = new int[32][32]; mapFeaturesEnabled = flag; field_705_k = new NoiseGeneratorOctaves(random, 16); field_704_l = new NoiseGeneratorOctaves(random, 16); field_703_m = new NoiseGeneratorOctaves(random, 8); field_702_n = new NoiseGeneratorOctaves(random, 4); field_715_a = new NoiseGeneratorOctaves(random, 10); field_714_b = new NoiseGeneratorOctaves(random, 16); //mobSpawnerNoise = new NoiseOctaves(random, 8); }
public GenStandard(World w, bool flag) { worldObj = w; random = new java.util.Random(w.seed); field_35562_v = new double[256]; caveGenerator = new GenCaves(); //field_35559_d = new MapGenStronghold(); //field_35560_e = new MapGenVillage(); //field_35558_f = new MapGenMineshaft(); field_35564_x = new GenRavine(); //unusedIntArray32x32 = new int[32][32]; field_35563_t = flag; field_705_k = new NoiseOctaves(random, 16); field_704_l = new NoiseOctaves(random, 16); field_703_m = new NoiseOctaves(random, 8); field_702_n = new NoiseOctaves(random, 4); field_715_a = new NoiseOctaves(random, 10); field_714_b = new NoiseOctaves(random, 16); mobSpawnerNoise = new NoiseOctaves(random, 8); }
public static WeightedRandomChoice func_35693_a(java.util.Random random, ICollection <WeightedRandomChoice> collection, int i) { if (i <= 0) { throw new ArgumentException(); } int j = random.nextInt(i); for (IEnumerator <WeightedRandomChoice> iterator = collection.GetEnumerator(); iterator.MoveNext();) { WeightedRandomChoice weightedrandomchoice = (WeightedRandomChoice)iterator.Current; j -= weightedrandomchoice.field_35483_d; if (j < 0) { return(weightedrandomchoice); } } return(null); }
private async void button6_Click(object sender, EventArgs e) { InfaForExperimentClassification infa = new InfaForExperimentClassification(); //Инфа для второго потока Instances experimentdataSet = dataSet; experimentdataSet.setClassIndex(experimentdataSet.numAttributes() - 1); //Установка указателя на атрибут с классами java.util.Random rnd = new java.util.Random(); experimentdataSet.randomize(rnd); //Перемешивание исходного набора данных int trainSize = (int)Math.Round((double)(experimentdataSet.numInstances() * 0.66)); //0.66 - Процент даннхы на обучение int testSize = experimentdataSet.numInstances() - trainSize; infa.trainDataSet = new Instances(experimentdataSet, 0, trainSize); infa.testDataSet = new Instances(experimentdataSet, trainSize, testSize); labelStatus.Text = "Проводится эксперимент..."; ResultExperimentClassification result = await Task.Factory.StartNew(() => ExperimentClassification(infa)); Evaluation evaluation = result.evaluation; string[] row = new string[10]; row[0] = evaluation.weightedPrecision().ToString(); //Точность row[1] = evaluation.weightedRecall().ToString(); //Полнота row[2] = evaluation.weightedFMeasure().ToString(); //F-мера //Accuracy row[3] = (evaluation.pctCorrect() / 100).ToString(); //Достоверноесть row[4] = evaluation.weightedTruePositiveRate().ToString(); //TPR row[5] = evaluation.weightedFalsePositiveRate().ToString(); //FPR row[6] = evaluation.weightedAreaUnderROC().ToString(); //ROC row[7] = result.timeTrain.ElapsedTicks.ToString(); //Время обучения row[8] = result.timeTest.ElapsedTicks.ToString(); //Время тестирования row[9] = result.timeСlassification.ElapsedTicks.ToString(); //Время классификации 1 экзепляра dataGridView5.Rows.Add(row); labelStatus.Text = "Эксперимент завершён"; }
public MapGenBase() { field_947_a = 8; rand = new java.util.Random(); }
public RandomRedirect(java.util.Random r) { this.r = r; }
protected void generateCaveNode(long l, int i, int j, byte[] abyte0, double d, double d1, double d2, float f, float f1, float f2, int k, int i1, double d3) { double d4 = i * 16 + 8; double d5 = j * 16 + 8; float f3 = 0.0F; float f4 = 0.0F; java.util.Random random = new java.util.Random(l); if(i1 <= 0) { int j1 = field_947_a * 16 - 16; i1 = j1 - random.nextInt(j1 / 4); } bool flag = false; if(k == -1) { k = i1 / 2; flag = true; } int k1 = random.nextInt(i1 / 2) + i1 / 4; bool flag1 = random.nextInt(6) == 0; for(; k < i1; k++) { double d6 = 1.5D + (double)(MathHelper.sin(((float)k * 3.141593F) / (float)i1) * f * 1.0F); double d7 = d6 * d3; float f5 = MathHelper.cos(f2); float f6 = MathHelper.sin(f2); d += MathHelper.cos(f1) * f5; d1 += f6; d2 += MathHelper.sin(f1) * f5; if(flag1) { f2 *= 0.92F; } else { f2 *= 0.7F; } f2 += f4 * 0.1F; f1 += f3 * 0.1F; f4 *= 0.9F; f3 *= 0.75F; f4 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F; f3 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4F; if(!flag && k == k1 && f > 1.0F && i1 > 0) { generateCaveNode(random.nextLong(), i, j, abyte0, d, d1, d2, random.nextFloat() * 0.5F + 0.5F, f1 - 1.570796F, f2 / 3F, k, i1, 1.0D); generateCaveNode(random.nextLong(), i, j, abyte0, d, d1, d2, random.nextFloat() * 0.5F + 0.5F, f1 + 1.570796F, f2 / 3F, k, i1, 1.0D); return; } if(!flag && random.nextInt(4) == 0) { continue; } double d8 = d - d4; double d9 = d2 - d5; double d10 = i1 - k; double d11 = f + 2.0F + 16F; if((d8 * d8 + d9 * d9) - d10 * d10 > d11 * d11) { return; } if(d < d4 - 16D - d6 * 2D || d2 < d5 - 16D - d6 * 2D || d > d4 + 16D + d6 * 2D || d2 > d5 + 16D + d6 * 2D) { continue; } d8 = MathHelper.floor_double(d - d6) - i * 16 - 1; int l1 = (MathHelper.floor_double(d + d6) - i * 16) + 1; d9 = MathHelper.floor_double(d1 - d7) - 1; int i2 = MathHelper.floor_double(d1 + d7) + 1; d10 = MathHelper.floor_double(d2 - d6) - j * 16 - 1; int j2 = (MathHelper.floor_double(d2 + d6) - j * 16) + 1; if(d8 < 0) { d8 = 0; } if(l1 > 16) { l1 = 16; } if(d9 < 1) { d9 = 1; } //field_35530_d.getClass(); if(i2 > 128 - 8) { //field_35530_d.getClass(); i2 = 128 - 8; } if(d10 < 0) { d10 = 0; } if(j2 > 16) { j2 = 16; } bool flag2 = false; for(int k2 = (int) d8; !flag2 && k2 < l1; k2++) { for(int i3 = (int) d10; !flag2 && i3 < j2; i3++) { for(int j3 = i2 + 1; !flag2 && j3 >= d9 - 1; j3--) { //field_35530_d.getClass(); int k3 = (k2 * 16 + i3) * 128 + j3; if(j3 < 0) { continue; } //field_35530_d.getClass(); if(j3 >= 128) { continue; } if(abyte0[k3] == (byte)Blocks.AWater || abyte0[k3] == (byte)Blocks.SWater) { flag2 = true; } if(j3 != d9 - 1 && k2 != d8 && k2 != l1 - 1 && i3 != d10 && i3 != j2 - 1) { j3 = (int) d9; } } } } if(flag2) { continue; } for(int l2 = (int) d8; l2 < l1; l2++) { double d12 = (((double)(l2 + i * 16) + 0.5D) - d) / d6; for(int l3 = (int) d10; l3 < j2; l3++) { double d13 = (((double)(l3 + j * 16) + 0.5D) - d2) / d6; //field_35530_d.getClass(); int i4 = (l2 * 16 + l3) * 128 + i2; bool flag3 = false; if(d12 * d12 + d13 * d13 >= 1.0D) { continue; } int j4 = i2 - 1; bool label0 = false; do { if(j4 < d9) { label0 = true; break; } double d14 = (((double)j4 + 0.5D) - d1) / d7; if(d14 > -0.69999999999999996D && d12 * d12 + d14 * d14 + d13 * d13 < 1.0D) { byte byte0 = abyte0[i4]; if (byte0 == (byte)Blocks.Grass) { flag3 = true; } if (byte0 == (byte)Blocks.Stone || byte0 == (byte)Blocks.Dirt || byte0 == (byte)Blocks.Grass) { if(j4 < 10) { abyte0[i4] = (byte)Blocks.ALava; } else { abyte0[i4] = 0; if (flag3 && abyte0[i4 - 1] == (byte)Blocks.Dirt) { abyte0[i4 - 1] = (byte)Blocks.Grass; } } } } i4--; j4--; } while(true); if (label0) continue; } } if(flag) { break; } } }
/// <summary>Constructor</summary> /// <param name="mode">the mode of the encoder (0=NB, 1=WB, 2=UWB).</param> /// <param name="quality">the quality setting of the encoder (between 0 and 10).</param> /// <param name="in">the underlying input stream.</param> /// <param name="format">the target format of this stream's audio data.</param> /// <param name="length">the length in sample frames of the data in this stream.</param> /// <param name="size">the buffer size.</param> /// <exception> /// IllegalArgumentException /// if size <= 0. /// </exception> public Pcm2SpeexAudioInputStream(int mode, int quality, java.io.InputStream @in, javax.sound.sampled.AudioFormat format, long length, int size) : base(@in, format , length, size) { // public static final boolean DEFAULT_VBR = true; // .4s of audio // Speex variables // Ogg variables // Ogg initialisation granulepos = 0; if (streamSerialNumber == 0) { streamSerialNumber = new java.util.Random().nextInt(); } packetsPerOggPage = DEFAULT_PACKETS_PER_OGG_PAGE; packetCount = 0; pageCount = 0; // Speex initialisation framesPerPacket = DEFAULT_FRAMES_PER_PACKET; int samplerate = (int)format.getSampleRate(); if (samplerate < 0) { samplerate = DEFAULT_SAMPLERATE; } channels = format.getChannels(); if (channels < 0) { channels = DEFAULT_CHANNELS; } if (mode < 0) { mode = (samplerate < 12000) ? 0 : ((samplerate < 24000) ? 1 : 2); } this.mode = mode; javax.sound.sampled.AudioFormat.Encoding encoding = format.getEncoding(); if (quality < 0) { if (encoding is org.xiph.speex.spi.SpeexEncoding) { quality = ((org.xiph.speex.spi.SpeexEncoding)encoding).getQuality(); } else { quality = DEFAULT_QUALITY; } } encoder = new org.xiph.speex.SpeexEncoder(); encoder.init(mode, quality, samplerate, channels); if (encoding is org.xiph.speex.spi.SpeexEncoding && ((org.xiph.speex.spi.SpeexEncoding )encoding).isVBR()) { setVbr(true); } else { setVbr(false); } frameSize = 2 * channels * encoder.getFrameSize(); // Misc initialsation comment = "Encoded with " + org.xiph.speex.SpeexEncoder.VERSION; first = true; }
public GenFeatures() { field_947_a = 8; rand = new java.util.Random(); }
protected void func_35539_a(long l, int i, int j, byte[] abyte0, double d, double d1, double d2, float f, float f1, float f2, int k, int i1, double d3) { java.util.Random random; double d4; double d5; float f3; float f4; bool flag; label0: { random = new java.util.Random(l); d4 = i * 16 + 8; d5 = j * 16 + 8; f3 = 0.0F; f4 = 0.0F; if(i1 <= 0) { int j1 = field_947_a * 16 - 16; i1 = j1 - random.nextInt(j1 / 4); } flag = false; if(k == -1) { k = i1 / 2; flag = true; } float f5 = 1.0F; int k1 = 0; bool label0 = false; do { if(k1 >= 128) { label0 = true; break; } if(k1 == 0 || random.nextInt(3) == 0) { f5 = 1.0F + random.nextFloat() * random.nextFloat() * 1.0F; } field_35540_a[k1] = f5 * f5; k1++; } while (true); if (!label0) goto label0; } for(; k < i1; k++) { double d6 = 1.5D + (double)(MathHelper.sin(((float)k * 3.141593F) / (float)i1) * f * 1.0F); double d7 = d6 * d3; d6 *= (double)random.nextFloat() * 0.25D + 0.75D; d7 *= (double)random.nextFloat() * 0.25D + 0.75D; float f6 = MathHelper.cos(f2); float f7 = MathHelper.sin(f2); d += MathHelper.cos(f1) * f6; d1 += f7; d2 += MathHelper.sin(f1) * f6; f2 *= 0.7F; f2 += f4 * 0.05F; f1 += f3 * 0.05F; f4 *= 0.8F; f3 *= 0.5F; f4 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F; f3 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4F; if(!flag && random.nextInt(4) == 0) { continue; } double d8 = d - d4; double d9 = d2 - d5; double d10 = i1 - k; double d11 = f + 2.0F + 16F; if((d8 * d8 + d9 * d9) - d10 * d10 > d11 * d11) { return; } if(d < d4 - 16D - d6 * 2D || d2 < d5 - 16D - d6 * 2D || d > d4 + 16D + d6 * 2D || d2 > d5 + 16D + d6 * 2D) { continue; } d8 = MathHelper.floor_double(d - d6) - i * 16 - 1; int l1 = (MathHelper.floor_double(d + d6) - i * 16) + 1; d9 = MathHelper.floor_double(d1 - d7) - 1; int i2 = MathHelper.floor_double(d1 + d7) + 1; d10 = MathHelper.floor_double(d2 - d6) - j * 16 - 1; int j2 = (MathHelper.floor_double(d2 + d6) - j * 16) + 1; if(d8 < 0) { d8 = 0; } if(l1 > 16) { l1 = 16; } if(d9 < 1) { d9 = 1; } if(i2 > 128 - 8) { i2 = 128 - 8; } if(d10 < 0) { d10 = 0; } if(j2 > 16) { j2 = 16; } bool flag1 = false; for(int k2 = (int) d8; !flag1 && k2 < l1; k2++) { for(int i3 = (int) d10; !flag1 && i3 < j2; i3++) { for(int j3 = i2 + 1; !flag1 && j3 >= d9 - 1; j3--) { int k3 = (k2 * 16 + i3) * 128 + j3; if(j3 < 0) { continue; } if(j3 >= 128) { continue; } if(abyte0[k3] == (byte)Blocks.AWater || abyte0[k3] == (byte)Blocks.SWater) { flag1 = true; } if(j3 != d9 - 1 && k2 != d8 && k2 != l1 - 1 && i3 != d10 && i3 != j2 - 1) { j3 = (int) d9; } } } } if(flag1) { continue; } for(int l2 = (int) d8; l2 < l1; l2++) { double d12 = (((double)(l2 + i * 16) + 0.5D) - d) / d6; label1: for(int l3 = (int) d10; l3 < j2; l3++) { double d13 = (((double)(l3 + j * 16) + 0.5D) - d2) / d6; int i4 = (l2 * 16 + l3) * 128 + i2; bool flag2 = false; if(d12 * d12 + d13 * d13 >= 1.0D) { continue; } int j4 = i2 - 1; bool label1 = false; do { if(j4 < d9) { label1 = true; break; } double d14 = (((double)j4 + 0.5D) - d1) / d7; if((d12 * d12 + d13 * d13) * (double)field_35540_a[j4] + (d14 * d14) / 6D < 1.0D) { byte byte0 = abyte0[i4]; if(byte0 == (byte)Blocks.Grass) { flag2 = true; } if(byte0 == (byte)Blocks.Stone || byte0 == (byte)Blocks.Dirt || byte0 == (byte)Blocks.Grass) { if(j4 < 10) { abyte0[i4] = (byte)Blocks.ALava; } else { abyte0[i4] = 0; if(flag2 && abyte0[i4 - 1] == (byte)Blocks.Dirt) { abyte0[i4 - 1] = (byte)Blocks.Grass; } } } } i4--; j4--; } while(true); if (label1) continue; } } if(flag) { break; } } }
public GenTrees(long seed) : base() { rand = new java.util.Random(seed); }