Package hu.u_szeged.nbo.geometria.type

Examples of hu.u_szeged.nbo.geometria.type.GeomIntMatrix


  protected void initJelolestombok(){
    vaar("initJelolestombok");
   
    sorlekotes = new boolean[meretX];
    oszloplekotes = new boolean[meretY];
    jelolesmatrix = new GeomIntMatrix(meretX, meretY);
    for(int i=1; i<=meretX; i++){
      sorlekotes(i, false);
      for(int j=1; j<=meretY; j++)
        jelolesmatrix.setElement(i, j, 0);
    }
View Full Code Here


   *
   */
  void f10(){
    W = -1;
    int szumma = 0;
    c = new GeomIntMatrix(Mvesszo.gmMeret());
    for(int i=1; i<=c.getMeret().getX(); i++){
      GeomTeam team = (GeomTeam)Evesszo.gmIedikElem(i);
      for(int j=1; j<=c.getMeret().getY(); j++){
        GeomWork work = (GeomWork)Mvesszo.gmIedikElem(j);
       
View Full Code Here

    helyekSzama = resources.getPlaces().size();
    eroforrasTipusokSzama = resources.matrixTypePair.getMeret().getX();
    munkaTipusokSzama = resources.matrixTypePair.getMeret().getY();

    ktr = new GeomIntMatrix(helyekSzama, munkaTipusokSzama);
    ltr = new GeomIntMatrix(helyekSzama, eroforrasTipusokSzama);
    KAPij = new GeomIntMatrix(helyekSzama, eroforrasTipusokSzama);
    ktr.nullaz();
    ltr.nullaz();
  }
View Full Code Here

    Iterator iter = resources.getPlaces().iterator();
    while(iter.hasNext()){
      int placeId = ((GeomPlace)iter.next()).getId();
      int delta = ltr.getSorVektorByIndex(placeId).elemekOsszege() - ktr.getSorVektorByIndex(placeId).elemekOsszege();
      if(delta > 0){  /// 8/a
        GeomIntMatrix tiltas = new GeomIntMatrix(eroforrasTipusokSzama, munkaTipusokSzama+1);
        for(int i=1; i<=eroforrasTipusokSzama; i++){
          for(int j=1; j<=munkaTipusokSzama; j++)
            tiltas.setElement(i, j, 1-resources.matrixTypePair.getElement(i,j));
          tiltas.setElement(i, munkaTipusokSzama+1, 0);
        }
        GeomSzallitasiFeladat sz = new GeomSzallitasiFeladat();
        GeomIntVektor a = ltr.getSorVektorByIndex(placeId);
        GeomIntVektor b = ktr.getSorVektorByIndex(placeId);
        b.addElement(delta);
        GeomIntMatrix szallitas = sz.solve(tiltas, a, b);
        if(szallitas.elemekSzorzatOsszege(tiltas)!=0){
          for(int j=1; j<=tiltas.getMeret().getY(); j++){
            int nemTiltottElemSora = 0;
            for(int i=1; i<=tiltas.getMeret().getX(); i++){
              if(tiltas.getElement(i,j)==0 && nemTiltottElemSora==0){
                nemTiltottElemSora = i;
              }
              if(tiltas.getElement(i,j)*szallitas.getElement(i,j)>0){
                if(nemTiltottElemSora==0){
                  for(int l=i+1; l<=tiltas.getMeret().getX(); l++){
                    if(tiltas.getElement(l,j)==0 && nemTiltottElemSora==0){
                      nemTiltottElemSora = l;
                      break;
                    }
                  }
                  if(nemTiltottElemSora==0) throw new GeomKAPMatrixFillException();
                }
                int diff = szallitas.getElement(i,j);
                szallitas.setElementAdd(nemTiltottElemSora, szallitas.getMeret().getY(), -diff);
                szallitas.setElementAdd(i, szallitas.getMeret().getY(), diff);
              }
            }
          }
         
        }
        KAPij.setSorVektorByIndex(placeId, szallitas.getOszlopVektor(szallitas.getMeret().getY()));
      }else{      /// 8/b
        delta = 0-delta;
        GeomTeam team = new GeomTeam()//fiktiv
        GeomIntMatrix tiltas = new GeomIntMatrix(eroforrasTipusokSzama+1, munkaTipusokSzama);
        for(int i=1; i<=eroforrasTipusokSzama; i++){
          for(int j=1; j<=munkaTipusokSzama; j++)
            tiltas.setElement(i, j, 1-resources.matrixTypePair.getElement(i,j));
        }
        for(int j=1; j<=munkaTipusokSzama; j++)
          tiltas.setElement(eroforrasTipusokSzama+1, j, 0);
        GeomSzallitasiFeladat sz = new GeomSzallitasiFeladat();
        GeomIntVektor a = ltr.getSorVektorByIndex(placeId);
        GeomIntVektor b = ktr.getSorVektorByIndex(placeId);
        a.addElement(delta);
        GeomIntMatrix szallitas = sz.solve(tiltas, a, b);
        GeomIntVektor kapacitasHiany = new GeomIntVektor(eroforrasTipusokSzama);
        if(szallitas.elemekSzorzatOsszege(tiltas)!=0){
          for(int i=1; i<=eroforrasTipusokSzama; i++){
            for(int j=1; j<=munkaTipusokSzama; j++){
              if(tiltas.getElement(i,j)*szallitas.getElement(i,j)>0){
                kapacitasHiany.setElementAdd(i, 0-szallitas.getElement(i,j));
              }
            }
          }
        }
        for(int j=1; j<=munkaTipusokSzama; j++){
          int munkaKapacitasa = szallitas.getSorVektor(eroforrasTipusokSzama+1).getElement(j);
          if(munkaKapacitasa!=0)
            for(int i=1; i<=eroforrasTipusokSzama; i++){
              if(resources.matrixTypePair.getElement(i,j)==1){
                kapacitasHiany.setElementAdd(i, 0-munkaKapacitasa);
                break;
View Full Code Here

*/
public class GeomHozzarendelesiFeladat extends GeomMagyarModszer {
 
  public GeomIntMatrix solve(GeomIntMatrix eredeti){
    feladattipus = "Hozz�rendel�si feladat:";
    temp = new GeomIntMatrix(eredeti);
    meretX = temp.getMeret().getX();
    meretY = temp.getMeret().getY();
   
    //* init r�sz, sor, ill. oszlopminimumok
    initJelolestombok();
View Full Code Here

  boolean elfajuloALanc = true;
  int lancmin;
 
  public GeomIntMatrix solve(GeomIntMatrix eredeti, GeomIntVektor a, GeomIntVektor b){
    feladattipus = "Sz�ll�t�si feladat:";
    temp = new GeomIntMatrix(eredeti);
    this.a = a;
    this.b = b;
    meretX = temp.getMeret().getX();
    meretY = temp.getMeret().getY();
   
View Full Code Here

      }
    }
  }

  private void initSzallitasMatrix() {
    szallitasmatrix = new GeomIntMatrix(meretX, meretY);
    int A;
    int B;
    for(int i=1; i<=meretX; i++)
      for(int j=1; j<=meretY; j++)
        if(temp.getElement(i, j)!=0){
View Full Code Here

TOP

Related Classes of hu.u_szeged.nbo.geometria.type.GeomIntMatrix

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.