-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
abffbcf
commit dadc41d
Showing
111 changed files
with
5,409 additions
and
1,279 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
|
||
[docs] | ||
sphinx | ||
jaraco.packaging>=9 | ||
jaraco.tidelift>=1.4 | ||
rst.linker>=1.9 | ||
sphinx | ||
jaraco.tidelift>=1.4 | ||
|
||
[testing] | ||
pytest-black>=0.3.7 | ||
pytest>=6 | ||
pytest-checkdocs>=2.4 | ||
pytest-flake8 | ||
pytest-cov | ||
pytest-enabler>=1.0.1 | ||
pytest-flake8 | ||
pytest-mypy>=0.9.1 | ||
pytest-virtualenv | ||
pytest>=6 | ||
types-setuptools | ||
pytest-black>=0.3.7 | ||
pytest-mypy>=0.9.1 |
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,13 @@ | ||
CHANGELOG (SINCE 24 SEPTEMBER 2022). | ||
|
||
==================================== | ||
* Version 0.1.1 (26 October 2022) | ||
==================================== | ||
Stated to support heuristic algorithms. | ||
Started to support sensitvity analysis. | ||
Started to support extensible coding. | ||
|
||
==================================== | ||
* Version 0.1 (24 September 2022) | ||
=============================== | ||
Initial realse of FelooPy |
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
Binary file not shown.
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,27 @@ | ||
class model: | ||
def __init__(self, val=0): | ||
self.val = val | ||
|
||
def var1(self,val): | ||
self.var1 = val | ||
return self.var1+self.val | ||
|
||
def var2(self, val): | ||
self.var2 = val | ||
return self.var2+self.val | ||
|
||
def solve(self,val): | ||
return self.__init__(val) | ||
|
||
m = model(2) | ||
x = m.var1(0) | ||
y = m.var2(2) | ||
|
||
print(x) | ||
print(y) | ||
|
||
m.solve(100) | ||
|
||
print(x) | ||
print(y) | ||
|
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,30 @@ | ||
''' | ||
FelooPy version 0.1.1 | ||
Release: 26 October 2022 | ||
''' | ||
|
||
''' | ||
MIT License | ||
Copyright (c) 2022 Keivan Tafakkori & FELOOP (https://ktafakkori.github.io/) | ||
Redistribution and use in source and binary forms, with or without modification, are | ||
permitted provided that the following conditions are met: | ||
1. Redistributions of source code must retain the above copyright notice, this list of | ||
conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, this list | ||
of conditions and the following disclaimer in the documentation and/or other materials | ||
provided with the distribution. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
''' | ||
|
||
from .main import * |
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,44 @@ | ||
''' | ||
FelooPy version 0.1.1 | ||
Release: 26 October 2022 | ||
''' | ||
|
||
''' | ||
MIT License | ||
Copyright (c) 2022 Keivan Tafakkori & FELOOP (https://ktafakkori.github.io/) | ||
Redistribution and use in source and binary forms, with or without modification, are | ||
permitted provided that the following conditions are met: | ||
1. Redistributions of source code must retain the above copyright notice, this list of | ||
conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, this list | ||
of conditions and the following disclaimer in the documentation and/or other materials | ||
provided with the distribution. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
''' | ||
|
||
from .age import * | ||
from .ben import * | ||
from .bvar import * | ||
from .dis import * | ||
from .env import * | ||
from .fvar import * | ||
from .get import * | ||
from .inf import * | ||
from .ivar import * | ||
from .oper import * | ||
from .pvar import * | ||
from .sol import * | ||
from .svar import * | ||
from .opt import * | ||
from .sens import * |
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,79 @@ | ||
|
||
''' | ||
FelooPy version 0.1.1 | ||
Release: 26 October 2022 | ||
''' | ||
|
||
''' | ||
MIT License | ||
Copyright (c) 2022 Keivan Tafakkori & FELOOP (https://ktafakkori.github.io/) | ||
Redistribution and use in source and binary forms, with or without modification, are | ||
permitted provided that the following conditions are met: | ||
1. Redistributions of source code must retain the above copyright notice, this list of | ||
conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, this list | ||
of conditions and the following disclaimer in the documentation and/or other materials | ||
provided with the distribution. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
''' | ||
|
||
import numpy as np | ||
import math as mt | ||
|
||
class singleagent: | ||
def __init__(self, var_name, val, dim, type=None): | ||
self.var_name = var_name | ||
self.val = val | ||
self.dim = dim | ||
self.type = type | ||
|
||
def __call__(self, *args): | ||
if self.type == 'pvar': | ||
return self.val[sum(args[i]*mt.prod(len(self.dim[j]) for j in range(i+1, len(self.dim))) for i in range(len(self.dim)))] | ||
elif self.type == 'svar': | ||
return np.argsort(self.val[sum(args[i]*mt.prod(len(self.dim[j]) for j in range(i+1, len(self.dim))) for i in range(len(self.dim)))]) | ||
else: | ||
return np.round(self.val[sum(args[i]*mt.prod(len(self.dim[j]) for j in range(i+1, len(self.dim))) for i in range(len(self.dim)))]) | ||
|
||
def __getitem__(self, *args): | ||
if self.type == 'pvar': | ||
return self.val[sum(args[i]*mt.prod(len(self.dim[j]) for j in range(i+1, len(self.dim))) for i in range(len(self.dim)))] | ||
elif self.type == 'svar': | ||
return np.argsort(self.val[sum(args[i]*mt.prod(len(self.dim[j]) for j in range(i+1, len(self.dim))) for i in range(len(self.dim)))]) | ||
else: | ||
return np.round(self.val[sum(args[i]*mt.prod(len(self.dim[j]) for j in range(i+1, len(self.dim))) for i in range(len(self.dim)))]) | ||
|
||
|
||
class multiagent: | ||
def __init__(self, var_name, val, dim, type=None): | ||
self.var_name = var_name | ||
self.val = val | ||
self.dim = dim | ||
self.type = type | ||
|
||
def __call__(self, *args): | ||
if self.type == 'pvar': | ||
return self.val[:, sum(args[i]*mt.prod(len(self.dim[j]) for j in range(i+1, len(self.dim))) for i in range(len(self.dim)))] | ||
elif self.type == 'svar': | ||
return np.argsort(self.val[:, sum(args[i]*mt.prod(len(self.dim[j]) for j in range(i+1, len(self.dim))) for i in range(len(self.dim)))]) | ||
else: | ||
return np.round(self.val[:, sum(args[i]*mt.prod(len(self.dim[j]) for j in range(i+1, len(self.dim))) for i in range(len(self.dim)))]) | ||
|
||
def __getitem__(self, *args): | ||
if self.type == 'pvar': | ||
return self.val[:, sum(args[i]*mt.prod(len(self.dim[j]) for j in range(i+1, len(self.dim))) for i in range(len(self.dim)))] | ||
elif self.type == 'svar': | ||
return np.argsort(self.val[:, sum(args[i]*mt.prod(len(self.dim[j]) for j in range(i+1, len(self.dim))) for i in range(len(self.dim)))]) | ||
else: | ||
return np.round(self.val[:, sum(args[i]*mt.prod(len(self.dim[j]) for j in range(i+1, len(self.dim))) for i in range(len(self.dim)))]) |
Oops, something went wrong.