⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 map_manager.java

📁 分别是模糊识别、模糊聚类、模糊控制的实例代码
💻 JAVA
字号:
package fuzzy_control;

import java.util.*;
import java.io.*;

public class Map_manager {
  private String line;
  private ArrayList lines;
  private int width,height;
  private byte[][] map;

  public Map_manager(int h,int w)
  {
    height = h;
    width = w;
    try
    {
       loadMap("maps/map1.txt");
    }catch(IOException e){}
   }

  private void loadMap(String filename) throws IOException
  {
      lines = new ArrayList();
      BufferedReader reader = new BufferedReader(new FileReader(filename));

      while (true)
      {
          line = reader.readLine();
          if (line == null)
          {
              reader.close();
              break;
          }
         lines.add(line);
     }

      map = new byte[height][width];
      for (int x=0; x<height; x++)
      {
          String line = (String)lines.get(x);
          for (int y=0; y<width; y++)
          {
            map[x][y]=Byte.parseByte(line.valueOf(line.charAt(y)));
          }
      }
  }

  public byte[][] returnMap()
  {
      return map;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -