Package net.javlov

Examples of net.javlov.VectorState


    super(width, height, cellWidth, cellHeight);
    stateOptions = new ArrayList[width][height];
  }
 
  public void setOptionPool(List<? extends Option> options) {
    VectorState state;
    ArrayList<Option> eligibleOptions;
    for ( int i = 0; i < stateOptions.length; i++ ) {
      for ( int j = 0; j < stateOptions[0].length; j++ ) {
        eligibleOptions = new ArrayList<Option>();
        state = new VectorState(new double[]{i, j});
        for ( Option o : options )
          if ( o.isEligible(state) )
            eligibleOptions.add(o);
        stateOptions[i][j] = eligibleOptions; 
      }
View Full Code Here


    throw new UnsupportedOperationException();
  }

  @Override
  public State<double[]> getObservation(Agent agent) {
    VectorState st = new VectorState();
    for ( Sensor<double[]> s : sensors )
      st.append(s.getReading());
    return st;
  }
View Full Code Here

 
  public void preLoadStates(int width, int height) {
    gridStates = new VectorState[width][height];
    for ( int i = 0; i < width; i++ )
      for ( int j = 0; j < height; j++ )
        gridStates[i][j] = new VectorState(new double[]{i, j});
  }
View Full Code Here

    //TODO dangerous assumption: own body is always in range for distance sensors,
    //but might not be for other sensors
    if ( objectsInRange.size() < 2 )
      return new double[numChildren];

    VectorState st = new VectorState();
    for ( GroupedSensor gs : children ) {
      gs.translate(totaldx, totaldy);
      gs.rotate(totalRot, lastCentreX, lastCentreY);
      st.append(gs.getReadingFromObjects(objectsInRange));
    }
    totalRot = totaldx = totaldy = 0;
    return st.getData();
  }
View Full Code Here

    throw new UnsupportedOperationException();
  }

  @Override
  public State<double[]> getObservation(Agent agent) {
    VectorState st = new VectorState();
    for ( Sensor<double[]> s : sensors )
      st.append(s.getReading());
    return st;
  }
View Full Code Here

TOP

Related Classes of net.javlov.VectorState

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.