Ejemplo n.º 1
0
void AbelianEquationsSolver::makeSystem()
{
  for( int i = 0 ; i < rawSystem.length() ; i++ )
    {
      for( int j = 0 ; j < rawSystem[i].length() ; j++ )
	{
	  Generator g = rawSystem[i][j];
	  
	  if( abs( g.hash() ) > numberOfVariables )
	    {
	      Generator newg;
	      if( g.hash() > 0 )
		newg = Generator( g.hash() - numberOfVariables );
	      else
		newg = Generator( g.hash() + numberOfVariables );
	      
	      b[i] *= inv(newg);
	    }
	  else
	    system[i] *= g;
	}
      
      system[i] = system[i].freelyReduce();
      b[i] = b[i].freelyReduce();
    }
}
Ejemplo n.º 2
0
Monitor :: Monitor(int ilosc_stacji, double czas, bool wr)
{
    write = wr;
    liczba_stacji = ilosc_stacji;
    delta = 10000;
    activate(delta);
    czas_symulacji = czas;
    reset();
    Generator gen = Generator(int(time(NULL)));
    kanal = new Medium();
    for(int i = 0; i < liczba_stacji; i++)
    {
        (new Stacja(gen.hash()))->activate(0);
    }
    if(write)
    {
        delay = fopen("delay.txt","w");
    }
}