brute_force_test.py
Go to the documentation of this file.
1 #==============================================================================
2 # Copyright (C) 2021-2024 Wageningen University - All Rights Reserved
3 # Author: Gonzalo Mier
4 # BSD-3 License
5 #==============================================================================
6 
7 import pytest
8 import fields2cover as f2c
9 import math as m
10 from .SG_checker import IsSwathGenerationCorrect
11 
12 def near(a, b):
13  assert pytest.approx(a) == pytest.approx(b)
14 
15 
17  rand = f2c.Random(4);
18  obj = f2c.OBJ_NSwath();
19  sw_gen = f2c.SG_BruteForce();
20  sw_gen.setStepAngle(m.pi/180.0);
21  field = rand.genConvexField(1e3);
22  poly = field.getField().getCell(0);
23  IsSwathGenerationCorrect(sw_gen, obj, poly);
swath_generator.brute_force_test.near
def near(a, b)
Definition: brute_force_test.py:12
swath_generator.brute_force_test.test_fields2cover_swath_brute_gen_bestAngle
def test_fields2cover_swath_brute_gen_bestAngle()
Definition: brute_force_test.py:16
swath_generator.SG_checker.IsSwathGenerationCorrect
def IsSwathGenerationCorrect(sw_gen, obj, poly, swath_width=1.0, checks=100)
Definition: SG_checker.py:14
f2c::Random
Definition: random.h:23


fields2cover
Author(s):
autogenerated on Fri Apr 25 2025 02:18:31