...
 
Commits (44)
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredPackages">
<value>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="cython" />
</list>
</value>
</option>
</inspection_tool>
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/PRRT.iml" filepath="$PROJECT_DIR$/.idea/PRRT.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BookmarkManager">
<bookmark url="file://$PROJECT_DIR$/examples/receiver.py" line="0" mnemonic="1" />
</component>
<component name="ChangeListManager">
<list default="true" id="9bef3dd2-eebb-490a-9234-c387e9ee2243" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.idea/PRRT.iml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FUSProjectUsageTrigger">
<session id="-141414039">
<usages-collector id="statistics.lifecycle.project">
<counts>
<entry key="project.closed" value="2" />
<entry key="project.open.time.2" value="1" />
<entry key="project.open.time.6" value="1" />
<entry key="project.opened" value="2" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.open">
<counts>
<entry key="py" value="1" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.open">
<counts>
<entry key="Python" value="1" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.edit">
<counts>
<entry key="py" value="43" />
<entry key="txt" value="50" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.edit">
<counts>
<entry key="PLAIN_TEXT" value="50" />
<entry key="Python" value="43" />
</counts>
</usages-collector>
</session>
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/examples/receiver.py">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="15" selection-start-column="15" selection-end-column="15" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="Git.Settings">
<option name="PREVIOUS_COMMIT_AUTHORS">
<list>
<option value="Ashkan" />
</list>
</option>
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/examples/receiver.py" />
</list>
</option>
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="39" />
<option name="y" value="25" />
<option name="width" value="1327" />
<option name="height" value="743" />
</component>
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="PRRT" type="b2602c69:ProjectViewProjectNode" />
<item name="PRRT" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="PRRT" type="b2602c69:ProjectViewProjectNode" />
<item name="PRRT" type="462c0819:PsiDirectoryNode" />
<item name="examples" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
</panes>
</component>
<component name="PropertiesComponent">
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="settings.editor.selected.configurable" value="vcs.Subversion.SSH" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="SvnConfiguration">
<configuration>$USER_HOME$/.subversion</configuration>
<option name="sshConnectionType" value="PASSWORD" />
<option name="sshUserName" value="ashkan.taslimi@gmail.com" />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="9bef3dd2-eebb-490a-9234-c387e9ee2243" name="Default Changelist" comment="" />
<created>1538599258029</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1538599258029</updated>
</task>
<task id="LOCAL-00001" summary="Testing git push with pycharm!">
<created>1538600078801</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1538600078801</updated>
</task>
<option name="localTasksCounter" value="2" />
<servers />
</component>
<component name="ToolWindowManager">
<frame x="39" y="25" width="1327" height="743" extended-state="6" />
<layout>
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.25" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Version Control" order="7" show_stripe_button="false" />
<window_info active="true" anchor="bottom" id="Terminal" order="8" sideWeight="0.49846625" visible="true" weight="0.47960848" />
<window_info anchor="bottom" id="Event Log" order="9" sideWeight="0.50153375" side_tool="true" visible="true" weight="0.47960848" />
<window_info anchor="bottom" id="Python Console" order="10" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
</layout>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="Testing git push with pycharm!" />
<option name="LAST_COMMIT_MESSAGE" value="Testing git push with pycharm!" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/examples/receiver.py">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="15" selection-start-column="15" selection-end-column="15" />
<folding>
<element signature="e#0#10#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
</project>
\ No newline at end of file
#!/usr/bin/env python3.6
import sys
import prrt
......
/usr/local/lib/python3.6/dist-packages/prrt-0.0.9+148.gf39b2c6.dirty-py3.6-linux-x86_64.egg/prrt.py
/usr/local/lib/python3.6/dist-packages/prrt-0.0.9+148.gf39b2c6.dirty-py3.6-linux-x86_64.egg/prrt.cpython-36m-x86_64-linux-gnu.so
/usr/local/lib/python3.6/dist-packages/prrt-0.0.9+148.gf39b2c6.dirty-py3.6-linux-x86_64.egg/EGG-INFO/requires.txt
/usr/local/lib/python3.6/dist-packages/prrt-0.0.9+148.gf39b2c6.dirty-py3.6-linux-x86_64.egg/EGG-INFO/SOURCES.txt
/usr/local/lib/python3.6/dist-packages/prrt-0.0.9+148.gf39b2c6.dirty-py3.6-linux-x86_64.egg/EGG-INFO/native_libs.txt
/usr/local/lib/python3.6/dist-packages/prrt-0.0.9+148.gf39b2c6.dirty-py3.6-linux-x86_64.egg/EGG-INFO/dependency_links.txt
/usr/local/lib/python3.6/dist-packages/prrt-0.0.9+148.gf39b2c6.dirty-py3.6-linux-x86_64.egg/EGG-INFO/PKG-INFO
/usr/local/lib/python3.6/dist-packages/prrt-0.0.9+148.gf39b2c6.dirty-py3.6-linux-x86_64.egg/EGG-INFO/not-zip-safe
/usr/local/lib/python3.6/dist-packages/prrt-0.0.9+148.gf39b2c6.dirty-py3.6-linux-x86_64.egg/EGG-INFO/top_level.txt
/usr/local/lib/python3.6/dist-packages/prrt-0.0.9+148.gf39b2c6.dirty-py3.6-linux-x86_64.egg/__pycache__/prrt.cpython-36.pyc
/usr/local/bin/cygdb
/usr/local/bin/cython
/usr/local/bin/cythonize
1. Clone the branch:
git clone --single-branch --branch feature/hecClasses https://git.nt.uni-saarland.de/LARN/PRRT.git
2. Find a pattern in files
grep -rnw '/path/to/somewhere/' -e 'pattern'
r = recursive i.e, search subdirectories within the current directory
n = to print the line numbers to stdout
i = case insensitive search
\ No newline at end of file
cython==0.29.10
numpy==1.16.4
pandas==0.24.2
scipy==1.1.0
prrt.c
RestrictedIntegerComposition.c
\ No newline at end of file
# Default ignored files
/workspace.xml
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredPackages">
<value>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="cython" />
</list>
</value>
</option>
</inspection_tool>
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/../../GreedySearch/.idea/GreedySearch.iml" filepath="$PROJECT_DIR$/../../GreedySearch/.idea/GreedySearch.iml" />
<module fileurl="file://$PROJECT_DIR$/../.idea/PRRT.iml" filepath="$PROJECT_DIR$/../.idea/PRRT.iml" />
<module fileurl="file://$PROJECT_DIR$/../../examples/.idea/examples.iml" filepath="$PROJECT_DIR$/../../examples/.idea/examples.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/prrt.iml" filepath="$PROJECT_DIR$/.idea/prrt.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="GreedySearch" />
<orderEntry type="module" module-name="examples" />
<orderEntry type="module" module-name="PRRT" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
app_max_latency,app_max_residual_loss_rate,app_data_rate,app_pkt_length,ch_loss_rate,ch_rtt_prop_fwd,ch_data_rate_btl_fwd,sys_block_coding_dly,sys_red_pkt_trans_dly,sys_proc_dly,sys_pkt_loss_detection_dly,sys_src_pkt_interval
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0027,400.0,1e-06,3e-05,1e-05,0.0005,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0027,400.0,1e-06,3e-05,1e-05,0.0005,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0027,400.0,1e-06,3e-05,1e-05,0.0005,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0027,400.0,1e-06,3e-05,1e-05,0.0005,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0027,400.0,1e-06,3e-05,1e-05,0.00014,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0027,400.0,1e-06,3e-05,1e-05,0.00014,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0027,400.0,1e-06,3e-05,1e-05,0.00014,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0027,400.0,1e-06,3e-05,1e-05,0.00014,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0027,400.0,1e-06,3e-05,1e-05,4e-05,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0027,400.0,1e-06,3e-05,1e-05,4e-05,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0027,400.0,1e-06,3e-05,1e-05,4e-05,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0027,400.0,1e-06,3e-05,1e-05,4e-05,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0027,400.0,1e-06,3e-05,1e-05,1e-05,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0027,400.0,1e-06,3e-05,1e-05,1e-05,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0027,400.0,1e-06,3e-05,1e-05,1e-05,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0027,400.0,1e-06,3e-05,1e-05,1e-05,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.0005,0.0005,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.0005,0.0005,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.0005,0.0005,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.0005,0.0005,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.0005,0.00014,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.0005,0.00014,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.0005,0.00014,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.0005,0.00014,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.0005,4e-05,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.0005,4e-05,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.0005,4e-05,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.0005,4e-05,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.0005,1e-05,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.0005,1e-05,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.0005,1e-05,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.0005,1e-05,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.00014,0.0005,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.00014,0.0005,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.00014,0.0005,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.00014,0.0005,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.00014,0.00014,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.00014,0.00014,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.00014,0.00014,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.00014,0.00014,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.00014,4e-05,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.00014,4e-05,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.00014,4e-05,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.00014,4e-05,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.00014,1e-05,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.00014,1e-05,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.00014,1e-05,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,0.00014,1e-05,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,4e-05,0.0005,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,4e-05,0.0005,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,4e-05,0.0005,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,4e-05,0.0005,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,4e-05,0.00014,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,4e-05,0.00014,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,4e-05,0.00014,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,4e-05,0.00014,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,4e-05,4e-05,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,4e-05,4e-05,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,4e-05,4e-05,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,4e-05,4e-05,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,4e-05,1e-05,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,4e-05,1e-05,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,4e-05,1e-05,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,4e-05,1e-05,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,1e-05,0.0005,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,1e-05,0.0005,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,1e-05,0.0005,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,1e-05,0.0005,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,1e-05,0.00014,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,1e-05,0.00014,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,1e-05,0.00014,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,1e-05,0.00014,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,1e-05,4e-05,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,1e-05,4e-05,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,1e-05,4e-05,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,1e-05,4e-05,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,1e-05,1e-05,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,1e-05,1e-05,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,1e-05,1e-05,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,30.0,1e-05,1e-05,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.0005,0.0005,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.0005,0.0005,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.0005,0.0005,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.0005,0.0005,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.0005,0.00014,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.0005,0.00014,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.0005,0.00014,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.0005,0.00014,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.0005,4e-05,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.0005,4e-05,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.0005,4e-05,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.0005,4e-05,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.0005,1e-05,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.0005,1e-05,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.0005,1e-05,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.0005,1e-05,0.0001
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.00014,0.0005,0.5
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.00014,0.0005,0.0292
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.00014,0.0005,0.0017
1.0,0.00073681,10000000.0,428.0,2.71e-06,0.0001,10000000.0,0.01,0.30652,0.00014,0.0005,0.0001
This diff is collapsed.
This diff is collapsed.
import fec_balance_utils
fec_balance_utils_obj = fec_balance_utils.FecBalanceUtils("documents/ml/input_predicted_fec_balance")
# ri = fec_balance_utils_obj.get_ri_single_input(35)
# print(ri)
fec_balance_utils_obj.get_all_ri()
# conf = ric.gen_repair_schedule(3, 10, 1, 1)
# print(conf)
\ No newline at end of file
import math
import prrt
import time
import numpy as np
import pandas as pd
import prrt_utils
import restricted_integer_composition as ric
class FecBalanceUtils:
def __init__(self, predicted_table_path):
self.predicted_table_in_df = pd.read_csv(predicted_table_path, sep=',')
self.n_max = 255
self.n_min = 1
self.n_p_min = 1
self.k = 0
self.n = 0
self.repair_schedule = []
self.nc_cap = 10
self.nc = 0
self.columns_order = ["app_max_latency", "app_max_residual_loss_rate", "app_data_rate", "app_pkt_length",
"ch_loss_rate", "ch_rtt_prop_fwd", "ch_data_rate_btl_fwd",
"sys_red_pkt_trans_dly", "sys_src_pkt_interval",
"fec_balance", "config", "time", "ri"]
print("FecBalanceUtils Class is initialized")
def get_arq_delay(self, index):
d_t = self.predicted_table_in_df["app_max_latency"][index]
fec_balance = self.predicted_table_in_df["fec_balance"][index]
return (1 - fec_balance) * d_t
def get_nc(self, index):
arq_delay = self.get_arq_delay(index)
ch_rtt_prop_fwd = self.predicted_table_in_df["ch_rtt_prop_fwd"][index]
sys_red_pkt_trans_dly = self.predicted_table_in_df["sys_red_pkt_trans_dly"][index]
nc = math.floor(arq_delay / (ch_rtt_prop_fwd + sys_red_pkt_trans_dly))
return nc
def get_k(self, index):
d_t = self.predicted_table_in_df["app_max_latency"][index]
ch_rtt_prop_fwd = self.predicted_table_in_df["ch_rtt_prop_fwd"][index]
sys_red_pkt_trans_dly = self.predicted_table_in_df["sys_red_pkt_trans_dly"][index]
sys_src_pkt_interval = self.predicted_table_in_df["sys_src_pkt_interval"][index]
self.nc = min(self.get_nc(index), self.nc_cap)
k = (d_t - ch_rtt_prop_fwd - self.nc * (ch_rtt_prop_fwd + sys_red_pkt_trans_dly)) / max(sys_red_pkt_trans_dly, sys_src_pkt_interval)
return math.floor(k)
def get_ri_single_input(self, index):
k_lim = prrt_utils.get_k_lim(self.n_min, self.n_max, self.predicted_table_in_df["ch_loss_rate"][index],
self.predicted_table_in_df["app_max_residual_loss_rate"][index])
k_loss = self.get_k(index)
self.k = min(k_lim, k_loss)
ch_rtt_prop_fwd = self.predicted_table_in_df["ch_rtt_prop_fwd"][index]
ch_data_rate_btl_fwd = self.predicted_table_in_df["ch_data_rate_btl_fwd"][index]
ch_loss_rate = self.predicted_table_in_df["ch_loss_rate"][index]
app_pkt_length = self.predicted_table_in_df["app_pkt_length"][index]
app_max_residual_loss_rate = self.predicted_table_in_df["app_max_residual_loss_rate"][index]
n_p_max = prrt_utils.get_n_p_max(ch_rtt_prop_fwd, app_pkt_length, ch_data_rate_btl_fwd)
self.n = prrt_utils.estimate_n_for_k(self.k, min(self.n_max, self.nc * n_p_max), ch_loss_rate, app_max_residual_loss_rate)
if n_p_max == 0:
self.repair_schedule = []
return -1
self.repair_schedule = ric.gen_repair_schedule(self.n - self.k, self.nc, self.n_p_min, n_p_max)
appParams = prrt.PrrtApplicationParameters(self.predicted_table_in_df['app_max_latency'][index],
self.predicted_table_in_df['app_max_residual_loss_rate'][index],
self.predicted_table_in_df['app_data_rate'][index],
self.predicted_table_in_df['app_pkt_length'][index])
chnlParams = prrt.PrrtChannelParameters(self.predicted_table_in_df['ch_loss_rate'][index],
0,
self.predicted_table_in_df['ch_rtt_prop_fwd'][index],
0,
self.predicted_table_in_df['ch_data_rate_btl_fwd'][index],
0)
sysParams = prrt.PrrtSystemParameters(0,
np.round(self.predicted_table_in_df['sys_red_pkt_trans_dly'][index], 5),
0,
0,
self.predicted_table_in_df['sys_src_pkt_interval'][index])
coding_conf = prrt.PrrtCodingConfiguration(self.n, self.k, self.repair_schedule, appParams, chnlParams, sysParams)
return coding_conf.get_redundant_information()
def get_all_ri(self):
save_result_to = pd.DataFrame()
total_start = time.time()
for index, row in self.predicted_table_in_df.iterrows():
if index != -1:
print(index)
start_time = time.time()
ri = self.get_ri_single_input(index)
duration = time.time() - start_time
# print(duration)
save_result_to = save_result_to.append({'app_max_latency': row['app_max_latency'],
'app_max_residual_loss_rate': row['app_max_residual_loss_rate'],
'app_data_rate': row['app_data_rate'],
'app_pkt_length': row['app_pkt_length'],
'ch_loss_rate': row['ch_loss_rate'],
'ch_rtt_prop_fwd': row['ch_rtt_prop_fwd'],
'ch_data_rate_btl_fwd': row['ch_data_rate_btl_fwd'],
'sys_red_pkt_trans_dly': np.round(row['sys_red_pkt_trans_dly'], 5),
'sys_src_pkt_interval': row['sys_src_pkt_interval'],
'fec_balance': row['fec_balance'],
'config': [self.k, self.n, self.repair_schedule, self.nc],
'time' : duration,
'ri':ri}, ignore_index=True, sort=False)
save_result_to.to_csv('document/ml/input_predicted_fec_balance_ml_result', sep=',', columns = self.columns_order)
print(time.time() - total_start)
\ No newline at end of file
import prrt
import math
import numpy as np
import restricted_integer_composition as ric
import prrt_utils
class HECSearch:
def __init__(self, searchType, n_p_min, n_p_max, prrtApplicationParameters, prrtChannelParameters,
prrtSystemParameters):
self.n_max = 255
self.n_min = 1
self.n_p_min = n_p_min
self.n_p_max = n_p_max
self.prrtApplicationParameters = prrtApplicationParameters
self.prrtChannelParameters = prrtChannelParameters
self.prrtSystemParameters = prrtSystemParameters
self.searchType = searchType
pass
def search(self):
ri_opt = math.inf
k_opt = 0
n_opt = 0
n_p_opt = []
n_c_cap = 10
fec_balance = -1
n_c_max = math.floor((self.prrtApplicationParameters.max_latency - self.get_fec_delay_min()) /
(self.prrtChannelParameters.rtt_prop_fwd +
self.prrtSystemParameters.redundancy_packet_transmission_delay))
n_c_max = min(n_c_max, n_c_cap)
# print("n_c_max=" + str(n_c_max))
arq_delay_i = self.prrtChannelParameters.rtt_prop_fwd \
+ self.prrtSystemParameters.redundancy_packet_transmission_delay
# self.k_lim = somewhat(prrtApplicationParameters.loss_tolerance, self.n_max)
#
# if self.searchType == "FullSearch":
# for n_c in range(n_c_max + 1):
# # Eq.5.11, k(Nc, D_T), page 125
# k_max = min(self.get_k(n_c, arq_delay), self.get_k_lim(1, self.n_max))
# for k in range(1, k_max + 1):
# n = self.estimate_n_for_k(k)
# repair_schedules = ric.gen_repair_schedules(n - k, n_c, self.n_p_min, self.n_p_max, False)
# for repair_schedule in repair_schedules:
# coding_conf = prrt.PrrtCodingConfiguration(n, k, repair_schedule,
# self.prrtApplicationParameters,
# self.prrtChannelParameters,
# self.prrtSystemParameters)
# ri = coding_conf.get_redundant_information()
# if ri < ri_opt:
# ri_opt = ri
# k_opt = k
# n_opt = n
# n_p_opt = repair_schedule
# return prrt.PrrtCodingConfiguration(n_opt, k_opt, n_p_opt)
get_k_lim = prrt_utils.get_k_lim(self.n_min, self.n_max, self.prrtChannelParameters.loss_rate_fwd, self.prrtApplicationParameters.max_residual_loss_rate) # Bottleneck
# if self.searchType == "GreedySearch":
for n_c in range(1, n_c_max + 1):
get_k = self.get_k(n_c, arq_delay_i)
# print(str(get_k) + " " + str(get_k_lim))
k_max = min(get_k, get_k_lim)
n_max_for_k = min(self.n_max, n_c * self.n_p_max)
if k_max == 0:
continue
# print("k_max: " + str(k_max))
for k in [1, k_max]:
n = prrt_utils.estimate_n_for_k(k, n_max_for_k,
self.prrtChannelParameters.loss_rate_fwd,
self.prrtApplicationParameters.max_residual_loss_rate) # Bottleneck
redundancy = n - k
if redundancy * self.n_p_min < n_c:
continue
repair_schedule = ric.gen_repair_schedule(redundancy, n_c, self.n_p_min, self.n_p_max)
# print("k=" + str(k) + " r=" + str(redundancy) + " n_c=" + str(n_c) + " n_p=" + str(repair_schedule))
coding_conf = prrt.PrrtCodingConfiguration(n, k, repair_schedule, self.prrtApplicationParameters,
self.prrtChannelParameters, self.prrtSystemParameters)
# coding_conf_validation_result = coding_conf.is_valid_for() # Bottleneck
if not (coding_conf.is_maximum_latency_fulfilled() and
prrt_utils.is_maximum_loss_fulfilled(k, n,
self.prrtChannelParameters.loss_rate_fwd,
self.prrtApplicationParameters.max_residual_loss_rate)):
# print("Coding conf is not valid: " + str(coding_conf_validation_result))
continue
ri = coding_conf.get_redundant_information()
# print("k=" + str(k) + " r=" + str(redundancy) + " n_c=" + str(n_c) + " n_p=" + str(repair_schedule) + "RI= " + str(ri))
if ri < ri_opt:
ri_opt = ri
k_opt = k
n_opt = n
n_p_opt = repair_schedule
# print("k_opt=" + str(k_opt) + " n_opt=" + str(n_opt) + " n_p_opt=" + str(n_p_opt) + "RI= " + str(ri_opt))
if len(n_p_opt) != 0:
fec_balance = self.get_balance_delay_fec(n_p_opt[0], k_opt)
return [k_opt, n_opt, n_p_opt, n_c, fec_balance, ri_opt]
def get_k(self, n_c, arq_delay_i):
return math.floor((self.prrtApplicationParameters.max_latency -
self.prrtChannelParameters.rtt_prop_fwd -
n_c * arq_delay_i) / max(self.prrtSystemParameters.redundancy_packet_transmission_delay, self.prrtSystemParameters.source_packet_interval))
def get_fec_delay_min(self):
return max(self.prrtSystemParameters.redundancy_packet_transmission_delay,
self.prrtSystemParameters.source_packet_interval) \
+ self.prrtChannelParameters.rtt_prop_fwd
def get_fec_delay(self, np_zero, k):
return k * max(self.prrtSystemParameters.redundancy_packet_transmission_delay, self.prrtSystemParameters.source_packet_interval) + \
np_zero * (self.prrtSystemParameters.block_coding_delay + self.prrtSystemParameters.redundancy_packet_transmission_delay) + \
self.prrtChannelParameters.rtt_prop_fwd
def get_balance_delay_fec(self, np_zero, k):
return self.get_fec_delay(np_zero, k) / self.prrtApplicationParameters.max_latency
\ No newline at end of file
This diff is collapsed.
from scipy.special import comb
import numpy as np
import math
from cython cimport cdivision
cdef int step_size = 1 # Step size in the estimation of the optimum code word length
# TODO: Maybe running in parallel to optimize runtime
# Pm(e, m), Eq. 3.45, Page 91
cpdef float get_error_prob(int j, int sent_packets_item, float p_e):
return comb(sent_packets_item, j) * (p_e ** j) * ((1 - p_e) ** (sent_packets_item - j))
# TODO
# Check if it is able to fulfill application parameters given channel parameters.
@cdivision(True)
cpdef float hypergeometric_distribution(int n, int k, int i, int j):
return (comb(k, i) * comb(n - k, j - i)) / comb(n, j)
@cdivision(True)
cpdef float residual_packet_erasure_rate(int k, int n, float ch_loss_rate):
cdef:
float total_packet_erasure = 0
unsigned int i, j
for i in range(1, k + 1):
for j in range(max(n - k + 1, i), n - k + i + 1):
total_packet_erasure += i * hypergeometric_distribution(n, k, i, j) \
* get_error_prob(j, n, ch_loss_rate)
# Pr(k, n)
return total_packet_erasure / k
@cdivision(True)
cpdef int get_k_lim(int smallestK, int biggestK, float loss_rate_fwd, float max_residual_loss_rate):
if biggestK < smallestK:
return smallestK
cdef int mid_point = math.ceil((biggestK + smallestK) / 2)
cdef float p_r = np.around(residual_packet_erasure_rate(mid_point, biggestK, loss_rate_fwd),8) # Pr(k, n_max)
if p_r == max_residual_loss_rate:
return int(mid_point)
elif p_r > max_residual_loss_rate:
return get_k_lim(smallestK, mid_point - 1, loss_rate_fwd, max_residual_loss_rate)
else:
return get_k_lim(mid_point + 1, biggestK, loss_rate_fwd, max_residual_loss_rate)
cpdef int estimate_n_for_k(int k, int n_max, float loss_rate_fwd,float max_residual_loss_rate):
cdef int n = k + 1
while residual_packet_erasure_rate(k, n, loss_rate_fwd) > max_residual_loss_rate \
and n <= n_max - step_size:
n += step_size
return n
@cdivision(True)
cpdef bint is_maximum_loss_fulfilled(int k, int n, float loss_rate_fwd, float max_residual_loss_rate):
cdef:
float total_packet_erasure = 0
int i, j
for i in range(1, k):
for j in range(max(n - k + 1, i), n - k + i):
packet_erasure_at_i = i * hypergeometric_distribution(n, k, i, j) * \
get_error_prob(j, n, loss_rate_fwd)
total_packet_erasure += packet_erasure_at_i
cdef float residual_packet_erasure_rate = total_packet_erasure / k # Pr(k, n)
if (residual_packet_erasure_rate <= max_residual_loss_rate):
return True
return False
@cdivision(True)
cpdef get_n_p_max(float rtt_prop_fwd, int pkt_length, float data_rate_btl_fwd):
n_p_max = rtt_prop_fwd * data_rate_btl_fwd / pkt_length
return np.round(n_p_max,0)
\ No newline at end of file
This diff is collapsed.
# import pyximport; pyximport.install()
import itertools
def generate_ric(redundancy, positions, min, max):
cdef c_redundancy = redundancy
cdef c_positions = positions
cdef c_min = min
cdef c_max = max
if c_positions < 1:
raise StopIteration
if c_positions == 1:
if c_redundancy >= c_min and c_redundancy <= c_max:
yield (c_redundancy,)
raise StopIteration
for i in range(c_min, c_redundancy + 1):
for result in generate_ric(c_redundancy - i, c_positions - 1, i, c_max):
if i <= c_max:
yield (i,) + result
# is_order_ascending = False for full search.
def gen_repair_schedules(redundancy, positions, min, max, is_order_ascending):
arbitrary_schedules = []
ordered_schedules = set()
f = generate_ric(redundancy, positions, min, max)
for i in f:
arbitrary_schedules.append(i)
if not is_order_ascending:
for i in arbitrary_schedules:
ordered_schedules.add(itertools.permutations(i))
return list(ordered_schedules)
else:
return arbitrary_schedules
def gen_repair_schedule(redundancy, numberOfCycles, minPossibleRedundancy, maxPossibleRedundancy):
if minPossibleRedundancy > maxPossibleRedundancy:
# raise Exception("Illegal input combinations. Make sure the minPossibleRedundancy < maxPossibleRedundancy.")
return []
# Only proactive cycle.
if numberOfCycles == 0:
return [redundancy]
optRepairSchedule = [0]
positionsToFill = 1
# fill all reactive cycles with minimum possible amount of redundancies: minPossibleRedundancy
while redundancy > 0 and positionsToFill <= numberOfCycles:
optRepairSchedule += [minPossibleRedundancy]
redundancy -= minPossibleRedundancy
positionsToFill += 1
# insert the rest of redundancy packets to the very last rounds if possible.
while redundancy > 0 and numberOfCycles > 0:
if optRepairSchedule[numberOfCycles] < maxPossibleRedundancy:
optRepairSchedule[numberOfCycles] += 1
redundancy -= 1
else:
numberOfCycles -= 1
# if all the reactive cycles filled with maxPossibleRedundancy and still some redundancies left, insert them in the proactive cycle (0).
if redundancy > 0:
optRepairSchedule[0] += redundancy
return optRepairSchedule
\ No newline at end of file
config,duration,search
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[0, 0, []]",0.0,GreedySearch
"[240, 2, [1, 9]]",25.0,GreedySearch
"[240, 2, [1, 9]]",25.0,GreedySearch
"[240, 2, [1, 9]]",24.0,GreedySearch
"[240, 2, [1, 9]]",25.0,GreedySearch
"[240, 2, [1, 9]]",25.0,GreedySearch
"[240, 2, [1, 9]]",54.0,GreedySearch
"[240, 2, [1, 9]]",30.0,GreedySearch
"[240, 2, [1, 9]]",28.0,GreedySearch
"[240, 2, [1, 9]]",26.0,GreedySearch
"[240, 2, [1, 9]]",26.0,GreedySearch
import os
import sys
import prrt
import time
import datetime
import hec_search
import numpy as np
import pandas as pd
import prrt_utils
from multiprocessing import Pool
# --------------------------------------------------------------
# Generate dataset
# ds_all_input = set(os.listdir("/home/ashkan/Documents/hecps/code/ML/data_left_in_small_ds/ds17/")) # TODO: Adjust dataset dir
# print(len(ds_all_input))
# ds_calculated_output = set(os.listdir("documents/output/out_ds17"))
# ds_calculated_output = {s.replace("out", "in") for s in ds_calculated_output}
# print(len(ds_calculated_output))
# ds_basename = list(ds_all_input - ds_calculated_output)
# print(len(ds_basename))
# ds_rel_input_path = "/home/ashkan/Documents/hecps/code/ML/data_left_in_small_ds/ds17/" # TODO: Adjust dataset dir
# ds_rel_output_path = "documents/output/out_ds17"
#----------------------------------------------------------------
# TODO: Adjust dataset dir
ds_basename = os.listdir("documents/ml/")
ds_basename = "input_predicted_fec_balance"
ds_rel_input_path = "documents/ml/"
ds_rel_output_path = "documents/ml/"
columns_order = ["app_max_latency", "app_max_residual_loss_rate", "app_data_rate", "app_pkt_length",
"ch_loss_rate", "ch_rtt_prop_fwd", "ch_data_rate_btl_fwd",
"sys_red_pkt_trans_dly", "sys_src_pkt_interval",
"fec_balance","config", "time", "ri"]
def evaluate(searchAlgorithm, appParams, channelParams, systemParams):
n_p_min = 1
n_p_max = prrt_utils.get_n_p_max(channelParams.rtt_prop_fwd, appParams.pkt_length, channelParams.data_rate_btl_fwd)
if n_p_min <= n_p_max:
start = time.time()
search = hec_search.HECSearch(searchAlgorithm, n_p_min, n_p_max, appParams, channelParams, systemParams)
search_result = search.search()
duration = time.time() - start
return [search_result, duration]
else:
return []
def test_case(dataset_basename):
save_result_to = pd.DataFrame()
# Load dataset in chunk
total_time = time.time()
for df_in_chunk in pd.read_csv(ds_rel_input_path + dataset_basename, sep=',', chunksize=100):
# print(dataset_basename + " started.")
for index, row in df_in_chunk.iterrows():
if index != -1:
print(index)
appParams = prrt.PrrtApplicationParameters(row['app_max_latency'], row['app_max_residual_loss_rate'], row['app_data_rate'], row['app_pkt_length'])
chnlParams = prrt.PrrtChannelParameters(row['ch_loss_rate'], 0, row['ch_rtt_prop_fwd'], 0, row['ch_data_rate_btl_fwd'], 0)
sysParams = prrt.PrrtSystemParameters(0, np.round(row['sys_red_pkt_trans_dly'], 5), 0, 0, row['sys_src_pkt_interval'])
for searchAlgorithm in ["GreedySearch"]:
search_result = evaluate(searchAlgorithm, appParams, chnlParams, sysParams)
if len(search_result) != 0:
config = search_result[0]
save_result_to = save_result_to.append({'app_max_latency': row['app_max_latency'],
'app_max_residual_loss_rate': row['app_max_residual_loss_rate'],
'app_data_rate' : row['app_data_rate'],
'app_pkt_length' : row['app_pkt_length'],
'ch_loss_rate' : row['ch_loss_rate'],
'ch_rtt_prop_fwd' : row['ch_rtt_prop_fwd'],
'ch_data_rate_btl_fwd' : row['ch_data_rate_btl_fwd'],
'sys_red_pkt_trans_dly' : np.round(row['sys_red_pkt_trans_dly'], 5),
'sys_src_pkt_interval' : row['sys_src_pkt_interval'],
'fec_balance': config[4],
'config': [config[0], config[1], config[2], config[3]],
'time': search_result[1],
'ri' : config[5]}, ignore_index=True, sort=False)
else:
save_result_to = save_result_to.append({'app_max_latency': row['app_max_latency'],
'app_max_residual_loss_rate': row['app_max_residual_loss_rate'],
'app_data_rate' : row['app_data_rate'],
'app_pkt_length' : row['app_pkt_length'],
'ch_loss_rate' : row['ch_loss_rate'],
'ch_rtt_prop_fwd' : row['ch_rtt_prop_fwd'],
'ch_data_rate_btl_fwd' : row['ch_data_rate_btl_fwd'],
'sys_red_pkt_trans_dly' : np.round(row['sys_red_pkt_trans_dly'], 5),
'sys_src_pkt_interval' : row['sys_src_pkt_interval'],
'fec_balance': -1,
'config': ["INV_PRM_NPM"],
'time' : 0,
'ri' : 0}, ignore_index=True, sort=False)
# save_result_to.to_csv(ds_rel_output_path + dataset_basename.replace("in", "out", 1), sep=',', index = False, columns = columns_order)
save_result_to.to_csv("documents/ml/input_predicted_fec_balance_greedy_result", sep=',', columns=columns_order)
print(time.time() - total_time)
# print(dataset_basename + " finished.")
#--- for testing and profiling ---#
test_case(ds_basename)
#--- Freeflow --- #
# if __name__ == '__main__':
# pool = Pool(processes=7) # TODO: Adjust number of cores
# pool.map(test_case, ds_basename, chunksize=1)
#--- scheduling --- #
# if __name__ == '__main__':
# pool = Pool(processes=7) # TODO: Adjust number of cores
# pool.imap_unordered(test_case, ds_basename, chunksize=1)
# job_started = False
# while True:
# time.sleep(60)
# current_DT = datetime.datetime.now()
# start_job_at = datetime.datetime(current_DT.year, current_DT.month, current_DT.day, 16, 44, 30) # TODO: Adjust start time
# end_job_at = datetime.datetime(current_DT.year, current_DT.month, current_DT.day, 16, 44, 40) # TODO: Adjust end time
#
# if end_job_at > current_DT > start_job_at:
# if not job_started:
# job_started = True
# someList = pool.imap_unordered(test_case, ds_basename, chunksize=1)
# print("Job has started at: " + str(current_DT))
# else:
# if job_started:
# print("Job has ended at: " + str(current_DT))
# job_started = False
# pool.terminate()
# pool.close()
# sys.exit("Time to go!")
......@@ -4,9 +4,15 @@ from Cython.Build import cythonize
import os, errno
import versioneer
ext = Extension(name='prrt', language="c", sources=["prrt/*.pyx"])
ext = [Extension(name='prrt', language="c", sources=["prrt/prrt.pyx"]),
Extension(name='restricted_integer_composition', language="c", sources=["prrt/restricted_integer_composition.pyx"]),
Extension(name='prrt_utils', language="c", sources=["prrt/prrt_utils.pyx"])
]
try:
os.remove(os.path.join(os.path.dirname(os.path.realpath(__file__)), "prrt/prrt.c"))
os.remove(os.path.join(os.path.dirname(os.path.realpath(__file__)), "prrt/restricted_integer_composition.c"))
os.remove(os.path.join(os.path.dirname(os.path.realpath(__file__)), "prrt/prrt_utils.c"))
except OSError as e:
if e.errno != errno.ENOENT:
raise
......
import unittest
import math
# import os, sys
# import pyximport
# pyximport.install()
# sys.path.append(os.path.join(os.path.dirname(__file__), '/home/local/Documents/thesis/hecps/code/PRRT/prrt'))
import prrt
# print(sys.path)
# print(dir(prrt.__path__))
# print(prrt.__file__)
class TestPrrtCodingConfiguration(unittest.TestCase):
def test_ri_01(self):
prrt_cp_obj = prrt.PrrtChannelParameters(0.1, 0, 0, 0, 0, 0)
prrt_cc_obj = prrt.PrrtCodingConfiguration(5, 2, [0, 1, 2])
ri = prrt_cc_obj.get_redundant_information(prrt_cp_obj)
print("RI for test config: (n, k, n_p)=(5, 2, [0, 1, 2]) , p_e = 0.1 >> ", ri)
assert math.isclose(ri, 0.01445, rel_tol=1e-03)
def test_ri_02(self):
prrt_cp_obj = prrt.PrrtChannelParameters(0.01, 0, 0, 0, 0, 0)
prrt_cc_obj = prrt.PrrtCodingConfiguration(5, 2, [0, 1, 2])
ri = prrt_cc_obj.get_redundant_information(prrt_cp_obj)
print("RI for test config: (n, k, n_p)=(5, 2, [0, 1, 2]), p_e = 0.01 >> ", ri)
assert math.isclose(ri, 0.0001490496, rel_tol=1e-03)
def test_ri_03(self):
prrt_cp_obj = prrt.PrrtChannelParameters(0.1, 0, 0, 0, 0, 0)
prrt_cc_obj = prrt.PrrtCodingConfiguration(8, 2, [1, 1, 2, 2])
ri = prrt_cc_obj.get_redundant_information(prrt_cp_obj)
print("RI for test config: (n, k, n_p)=(8, 2, [1, 1, 2, 2]), p_e = 0.1 >> ", ri)
assert math.isclose(ri, 0.50190719, rel_tol=1e-03)
if __name__ == '__main__':
unittest.main()
\ No newline at end of file