public void SetUp() { int iVertexCount = 40; m_rGraph = new CPathGraph(iVertexCount, 20); m_rLaw = new CGenLaw(20, iVertexCount); m_rLaw.UpdateParameters(1, 0, 100); m_rGenetic = new CGenetic(m_rLaw, m_rGraph); }
public CGenetic(CGenLaw rLaw, IGradeUpdater rUpdater) { if (rLaw != null && rUpdater != null) { m_rUpdater = rUpdater; m_rLaw = rLaw; } else { throw new FormatException("Размер группы должен быть больше 0"); } }
public CRunningAnt(CGenLaw rLaw, int iStartPos, SimpleOrderPool rOrderPool) { if (rLaw != null && rOrderPool != null && rLaw.IsPosInNet(iStartPos)) { m_rLaw = rLaw; m_rOrderPool = rOrderPool; StartPos = iStartPos; } else { throw new FormatException(); } }
public CGroup(IGradeUpdater rUpdater, CGenLaw rLaw) { if (rUpdater != null && rLaw != null) { m_rUpdater = rUpdater; m_rLaw = rLaw; m_aChromosomes = new List <CChromosome>(); GroupSize = 0; } else { throw new FormatException(); } }
public CChromosome(CGenLaw rLaw) { if (rLaw != null) { m_rLaw = rLaw; m_aGens = new int[rLaw.GensCount]; for (int i = 0; i < m_aGens.Length; i++) { m_aGens[i] = i; } MixGens(); } else { throw new FormatException("Законы генетики для хромосомы не могут быть равны null."); } }