-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated tests, removed problem instance dependency from space module
- Loading branch information
1 parent
6dd4580
commit c2c293d
Showing
28 changed files
with
555 additions
and
474 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
numpy~=1.25.2 | ||
numpy~=1.24.4 | ||
mpi4py~=3.1.4 | ||
python-sat~=0.1.8.dev9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
numpy~=1.25.2 | ||
numpy~=1.24.4 | ||
python-sat~=0.1.8.dev9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import unittest | ||
|
||
from space.model import Backdoor | ||
from pysatmc.variables import Range | ||
|
||
from core.model.point import Point | ||
from core.module.comparator import MinValueMaxSize | ||
|
||
|
||
class TestComparator(unittest.TestCase): | ||
def test_min_value_max_size(self): | ||
comparator = MinValueMaxSize() | ||
backdoor = Backdoor(Range(start=1, length=8)) | ||
self.assertGreater( | ||
Point(backdoor.make_copy([]), comparator).set(value=1000), | ||
Point(backdoor.make_copy([0, 0, 1]), comparator).set(value=900), | ||
) | ||
self.assertGreater( | ||
Point(backdoor.make_copy([0, 0, 1]), comparator).set(value=1000), | ||
Point(backdoor.make_copy([1, 1, 1]), comparator).set(value=1000), | ||
) | ||
self.assertEqual( | ||
Point(backdoor.make_copy([0, 1, 1]), comparator).set(value=1000), | ||
Point(backdoor.make_copy([1, 0, 1]), comparator).set(value=1000), | ||
) | ||
self.assertLess( | ||
Point(backdoor.make_copy([0, 1, 1]), comparator).set(value=1000), | ||
Point(backdoor.make_copy([0, 0, 1]), comparator).set(value=1000), | ||
) | ||
self.assertLess( | ||
Point(backdoor.make_copy([0, 1, 1]), comparator).set(value=1000), | ||
Point(backdoor.make_copy([1, 0, 1]), comparator).set( | ||
value=float('inf')), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import unittest | ||
|
||
from core.module.limitation import WallTime, Iteration | ||
|
||
|
||
class TestLimitation(unittest.TestCase): | ||
def test_iteration(self): | ||
limitation = Iteration(value=1000) | ||
self.assertEqual(limitation.exhausted(), False) | ||
self.assertEqual(limitation.left('time'), None) | ||
self.assertEqual(limitation.left('iteration'), 1000) | ||
|
||
limitation.increase('iteration', 990) | ||
self.assertEqual(limitation.left('iteration'), 10) | ||
|
||
limitation.set('iteration', 1234) | ||
self.assertEqual(limitation.left('iteration'), 0) | ||
self.assertEqual(limitation.get('iteration'), 1234) | ||
self.assertEqual(limitation.exhausted(), True) | ||
|
||
def test_wall_time(self): | ||
limitation = WallTime(from_string='02:13:45') | ||
self.assertEqual(limitation.exhausted(), False) | ||
self.assertEqual(limitation.left('time'), 8025) | ||
self.assertEqual(limitation.left('iteration'), None) | ||
|
||
limitation.increase('time', 654) | ||
self.assertEqual(limitation.get('time'), 654) | ||
self.assertEqual(limitation.left('time'), 7371) | ||
|
||
limitation.set('time', 10345) | ||
self.assertEqual(limitation.left('time'), 0) | ||
self.assertEqual(limitation.get('time'), 10345) | ||
self.assertEqual(limitation.exhausted(), True) |
File renamed without changes.
Oops, something went wrong.