public void AddParticleCost(ICore sectionCore, ICore homeCore, Particle particle, int step) { if (homeCore == sectionCore) { return; } var cost = (FieldAggCost + ChargeAggCost) * particleReductionFactor * CohesionCorrectionFactor; storage.AddCost(sectioncorerole, sectionCore, step, cost); storage.AddCost(sectioncorerole, homeCore, step, cost); }
public void AddCost(IParticleSection section, IParticleSection otherSection, int nBParticles, SimulationStructure structure, int step) { var core1 = section.Core; var core2 = otherSection.Core; if (core1 == core2) { return; } storage.AddCost(sendingCost, core1, step, nBParticles * particleReductionFactor * SendCost); storage.AddCost(receivingCost, core2, step, nBParticles * particleReductionFactor * ReceiveCost); }
private void SendAllCosts(ICore newCore, int step) { foreach (var receiveCore in receiveCores) { var singleReceiveCoreCosts = receiveCore.Value; foreach (var singleReceiveCoreCost in singleReceiveCoreCosts) { var singlePointSet = singleReceiveCoreCost.Value; var receiveStoreCost = singlePointSet.Count * CostReceivingPerCellCorner; var sendStorecost = singlePointSet.Count * CostSendingPerCellCorner; // Console.Out.WriteLine(receiveStoreCost); storage.AddCost(sendCost, currentCore, step, sendStorecost); storage.AddCost(receiveCost, receiveCore.Key, step, receiveStoreCost); } } receiveCores = new Dictionary <ICore, Dictionary <ISection, HashSet <Point3> > >(); currentCore = newCore; }
private void CalculateParticleCost(SimulationStructure structure, int step) { const double movementCost = 1.1454431510266E-007; const double chargeDepositionCost = 0.000000182; const double noReduction = movementCost + chargeDepositionCost; //Console.Out.WriteLine(noReduction); var sumCost = noReduction * particleReductionFactor; foreach (var core in structure.CoreGrid.GetCores()) { storage.AddCost(particleCost, core, step, core.Sections.Sum(o => o.Particles.Count() * sumCost)); } }
public void AddCostForCore(ICore core, int step) { storage.AddCost(constantCost, core, step, ConstantSolverCost + ConstantElecFieldCost); }
/*public void AddCalculationCost(ICostType compareCost, ICore outParticleSection, int step, double cost) * { * costStorage.AddCost(compareCost,outParticleSection,step,cost); * } */ public void AddSwapCost(ICore core, int nbParticles, SimulationStructure structure, int step) { costStorage.AddCost(swapCostType, core, step, nbParticles * swapCostValueInTime); }