コード例 #1
0
import random

from xml_generator import generate_file

if __name__ == "__main__":
  generate_file(
      "PercolationEdge0.xml",
      "Percolation", 18, 20,
      [0 for i in range(20)],
      [i for i in range(20)],
      [0, 0, 2, 0, 0,
       2, 0, 0, 2, 0,
       0, 2, 0, 0, 2,
       0, 0, 2, 0, 0],
      speed=20, title="Percolation edge 1", author='jt304',
      desc='Percolation edge 1'
  )

  generate_file(
      "PercolationEdge1.xml",
      "Percolation", 10, 15,
      [i for i in range(10)],
      [0 for i in range(10)],
      [0, 0, 2, 0, 0,
       2, 0, 0, 2, 0],
      speed=20, title="Percolation edge 2", author='jt304',
      desc='Percolation simulation 2'
  )

  for idx in range(4):
    cell_r = []
コード例 #2
0
from xml_generator import generate_file

if __name__ == "__main__":
    generate_file(
        "WaTor_Simulation2.xml",
        "WaTor",
        10,
        15,
        [1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9],
        [14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 3, 4, 5, 6, 7, 9, 10],
        [1, 2, 2, 2, 1, 2, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1],
        speed=20,
        title="WaTor simulation2",
        author='jw542',
        desc='Wator simulation 2 edge case',
        sim_configs=dict(fishBreedDuration=2,
                         sharkBreedDuration=4,
                         sharkStarveDuration=5),
    )
コード例 #3
0
from xml_generator import generate_file

if __name__ == "__main__":
    generate_file(
        "FireEdge1.xml",
        "Fire", 10, 15,
        [9, 9], [14, 14], [1, 2],
        speed=20, title="Fire simulation", author='jt304', desc='Fire simulation 1',
        sim_configs=dict(probCatch=0.6),
    )
コード例 #4
0
import random

from xml_generator import generate_file

if __name__ == "__main__":
    for idx in range(1):
        cell_r = []
        cell_c = []
        cell_s = []
        for i in range(30):
            for j in range(30):
                cell_r.append(i)
                cell_c.append(j)
                cell_s.append(random.choice([0, 1, 2]))

        generate_file(
            f"RPSRandom{idx}.xml",
            "RPS",
            30,
            30,
            cell_r,
            cell_c,
            cell_s,
            speed=1,
            title=f"RPS random {idx + 1}",
            author='jt304',
            desc=f'RPS simulation {idx + 1}',
            sim_configs=dict(threshold=4),
        )
コード例 #5
0
import random

from xml_generator import generate_file

if __name__ == "__main__":
    generate_file(
        "FireEdge0.xml",
        "Fire",
        18,
        20,
        [0 for i in range(20)],
        [i for i in range(20)],
        [1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1],
        speed=20,
        title="Fire edge 1",
        author='jt304',
        desc='Fire edge 1',
        sim_configs=dict(probCatch=0.6),
    )

    generate_file(
        "FireEdge1.xml",
        "Fire",
        10,
        15,
        [i for i in range(10)],
        [0 for i in range(10)],
        [1, 1, 2, 1, 1, 2, 1, 1, 2, 1],
        speed=20,
        title="Fire edge 2",
        author='jt304',