A4MCAR - Dummy load apps added (to stress Raspberry Pi)

Signed-off-by: Mustafa Ozcelikors <mozcelikors@gmail.com>
diff --git a/a4mcar/high_level_applications/apps/dummy_loads/dummy_load100.py b/a4mcar/high_level_applications/apps/dummy_loads/dummy_load100.py
new file mode 100644
index 0000000..500d614
--- /dev/null
+++ b/a4mcar/high_level_applications/apps/dummy_loads/dummy_load100.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2017 Eclipse Foundation and FH Dortmund.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Description:
+#    A4MCAR Project - High-level Module Dummy Load roughly 100% on a core
+#
+# Author:
+#    M. Ozcelikors <mozcelikors@gmail.com>
+
+import psutil
+import time
+import string
+import numpy
+
+#Timing Related ---start
+_DEADLINE = 0.50
+_START_TIME = 0
+_END_TIME = 0
+_EXECUTION_TIME = 0                  
+_PREV_SLACK_TIME = 0
+_PERIOD = 0.50 #0.47
+#Timing Related ---end
+
+def CreateTimingLog(filename):
+	global _START_TIME
+	global _DEADLINE
+	global _END_TIME
+	global _EXECUTION_TIME
+	global _PREV_SLACK_TIME
+	global _PERIOD
+        
+	try:
+		file_obj = open(str(filename), "w+r")
+	except Exception as inst:
+		print inst
+	_END_TIME = time.time()
+	_EXECUTION_TIME = _END_TIME - _START_TIME
+	try:
+		file_obj.write(str(_PREV_SLACK_TIME)+' '+str(_EXECUTION_TIME)+' '+str(_PERIOD)+' '+str(_DEADLINE))
+		file_obj.close()
+	except Exception as inst:
+		print inst
+	
+while True:
+	#Timing Related ---start
+	_START_TIME = time.time() 
+	_PREV_SLACK_TIME = _START_TIME - _END_TIME
+	#Timing Related ---end
+
+	#TASK CONTENT
+	a=numpy.random.random([1000,1000])
+	b=numpy.random.random([1000,1000])
+	c=numpy.mean(a*b)
+		
+	#Timing Related ---start
+	CreateTimingLog("../../logs/timing/dummy_load100_timing.inc")
+	#Timing Related ---end
+        
+	#Sleep
+	if (_PERIOD>_EXECUTION_TIME):
+		time.sleep(_PERIOD - _EXECUTION_TIME) 
diff --git a/a4mcar/high_level_applications/apps/dummy_loads/dummy_load25_1.py b/a4mcar/high_level_applications/apps/dummy_loads/dummy_load25_1.py
new file mode 100644
index 0000000..bcfad07
--- /dev/null
+++ b/a4mcar/high_level_applications/apps/dummy_loads/dummy_load25_1.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2017 Eclipse Foundation and FH Dortmund.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Description:
+#    A4MCAR Project - High-level Module Dummy Load roughly 25% on a core
+#
+# Author:
+#    M. Ozcelikors <mozcelikors@gmail.com>
+
+import psutil
+import time
+import string
+import numpy
+
+#Timing Related ---start
+_DEADLINE = 1.40
+_START_TIME = 0
+_END_TIME = 0
+_EXECUTION_TIME = 0                  
+_PREV_SLACK_TIME = 0
+_PERIOD = 1.40
+#Timing Related ---end
+
+def CreateTimingLog(filename):
+	global _START_TIME
+	global _DEADLINE
+	global _END_TIME
+	global _EXECUTION_TIME
+	global _PREV_SLACK_TIME
+	global _PERIOD
+        
+	try:
+		file_obj = open(str(filename), "w+r")
+	except Exception as inst:
+		print inst
+	_END_TIME = time.time()
+	_EXECUTION_TIME = _END_TIME - _START_TIME
+	try:
+		file_obj.write(str(_PREV_SLACK_TIME)+' '+str(_EXECUTION_TIME)+' '+str(_PERIOD)+' '+str(_DEADLINE))
+		file_obj.close()
+	except Exception as inst:
+		print inst
+	
+while True:
+	#Timing Related ---start
+	_START_TIME = time.time()
+	_PREV_SLACK_TIME = _START_TIME - _END_TIME
+	#Timing Related ---end
+
+	#TASK CONTENT
+	a=numpy.random.random([1000,1000])
+	b=numpy.random.random([1000,1000])
+	c=numpy.mean(a*b)
+		
+	#Timing Related ---start
+	CreateTimingLog("../../logs/timing/dummy_load25_1_timing.inc")
+	#Timing Related ---end
+        
+	#Sleep
+	if(_PERIOD>_EXECUTION_TIME):
+		time.sleep(_PERIOD - _EXECUTION_TIME)
diff --git a/a4mcar/high_level_applications/apps/dummy_loads/dummy_load25_2.py b/a4mcar/high_level_applications/apps/dummy_loads/dummy_load25_2.py
new file mode 100644
index 0000000..fde174b
--- /dev/null
+++ b/a4mcar/high_level_applications/apps/dummy_loads/dummy_load25_2.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2017 Eclipse Foundation and FH Dortmund.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Description:
+#    A4MCAR Project - High-level Module Dummy Load roughly 25% on a core
+#
+# Author:
+#    M. Ozcelikors <mozcelikors@gmail.com>
+
+import psutil
+import time
+import string
+import numpy
+
+#Timing Related ---start
+_DEADLINE = 1.40
+_START_TIME = 0
+_END_TIME = 0
+_EXECUTION_TIME = 0                  
+_PREV_SLACK_TIME = 0
+_PERIOD = 1.40
+#Timing Related ---end
+
+def CreateTimingLog(filename):
+	global _START_TIME
+	global _DEADLINE
+	global _END_TIME
+	global _EXECUTION_TIME
+	global _PREV_SLACK_TIME
+	global _PERIOD
+        
+	try:
+		file_obj = open(str(filename), "w+r")
+	except Exception as inst:
+		print inst
+	_END_TIME = time.time()
+	_EXECUTION_TIME = _END_TIME - _START_TIME
+	try:
+		file_obj.write(str(_PREV_SLACK_TIME)+' '+str(_EXECUTION_TIME)+' '+str(_PERIOD)+' '+str(_DEADLINE))
+		file_obj.close()
+	except Exception as inst:
+		print inst
+	
+while True:
+	#Timing Related ---start
+	_START_TIME = time.time()
+	_PREV_SLACK_TIME = _START_TIME - _END_TIME
+	#Timing Related ---end
+
+	#TASK CONTENT
+	a=numpy.random.random([1000,1000])
+	b=numpy.random.random([1000,1000])
+	c=numpy.mean(a*b)
+		
+	#Timing Related ---start
+	CreateTimingLog("../../logs/timing/dummy_load25_2_timing.inc")
+	#Timing Related ---end
+        
+	#Sleep
+	if(_PERIOD>_EXECUTION_TIME):
+		time.sleep(_PERIOD - _EXECUTION_TIME)
diff --git a/a4mcar/high_level_applications/apps/dummy_loads/dummy_load25_3.py b/a4mcar/high_level_applications/apps/dummy_loads/dummy_load25_3.py
new file mode 100644
index 0000000..4e12db8
--- /dev/null
+++ b/a4mcar/high_level_applications/apps/dummy_loads/dummy_load25_3.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2017 Eclipse Foundation and FH Dortmund.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Description:
+#    A4MCAR Project - High-level Module Dummy Load roughly 25% on a core
+#
+# Author:
+#    M. Ozcelikors <mozcelikors@gmail.com>
+
+import psutil
+import time
+import string
+import numpy
+
+#Timing Related ---start
+_DEADLINE = 1.40
+_START_TIME = 0
+_END_TIME = 0
+_EXECUTION_TIME = 0                  
+_PREV_SLACK_TIME = 0
+_PERIOD = 1.40
+#Timing Related ---end
+
+def CreateTimingLog(filename):
+	global _START_TIME
+	global _DEADLINE
+	global _END_TIME
+	global _EXECUTION_TIME
+	global _PREV_SLACK_TIME
+	global _PERIOD
+        
+	try:
+		file_obj = open(str(filename), "w+r")
+	except Exception as inst:
+		print inst
+	_END_TIME = time.time()
+	_EXECUTION_TIME = _END_TIME - _START_TIME
+	try:
+		file_obj.write(str(_PREV_SLACK_TIME)+' '+str(_EXECUTION_TIME)+' '+str(_PERIOD)+' '+str(_DEADLINE))
+		file_obj.close()
+	except Exception as inst:
+		print inst
+	
+while True:
+	#Timing Related ---start
+	_START_TIME = time.time()
+	_PREV_SLACK_TIME = _START_TIME - _END_TIME
+	#Timing Related ---end
+
+	#TASK CONTENT
+	a=numpy.random.random([1000,1000])
+	b=numpy.random.random([1000,1000])
+	c=numpy.mean(a*b)
+		
+	#Timing Related ---start
+	CreateTimingLog("../../logs/timing/dummy_load25_3_timing.inc")
+	#Timing Related ---end
+        
+	#Sleep
+	if(_PERIOD>_EXECUTION_TIME):
+		time.sleep(_PERIOD - _EXECUTION_TIME)
diff --git a/a4mcar/high_level_applications/apps/dummy_loads/dummy_load25_4.py b/a4mcar/high_level_applications/apps/dummy_loads/dummy_load25_4.py
new file mode 100644
index 0000000..7aa1bf8
--- /dev/null
+++ b/a4mcar/high_level_applications/apps/dummy_loads/dummy_load25_4.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2017 Eclipse Foundation and FH Dortmund.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Description:
+#    A4MCAR Project - High-level Module Dummy Load roughly 25% on a core
+#
+# Author:
+#    M. Ozcelikors <mozcelikors@gmail.com>
+
+import psutil
+import time
+import string
+import numpy
+
+#Timing Related ---start
+_DEADLINE = 1.40
+_START_TIME = 0
+_END_TIME = 0
+_EXECUTION_TIME = 0                  
+_PREV_SLACK_TIME = 0
+_PERIOD = 1.40
+#Timing Related ---end
+
+def CreateTimingLog(filename):
+	global _START_TIME
+	global _DEADLINE
+	global _END_TIME
+	global _EXECUTION_TIME
+	global _PREV_SLACK_TIME
+	global _PERIOD
+        
+	try:
+		file_obj = open(str(filename), "w+r")
+	except Exception as inst:
+		print inst
+	_END_TIME = time.time()
+	_EXECUTION_TIME = _END_TIME - _START_TIME
+	try:
+		file_obj.write(str(_PREV_SLACK_TIME)+' '+str(_EXECUTION_TIME)+' '+str(_PERIOD)+' '+str(_DEADLINE))
+		file_obj.close()
+	except Exception as inst:
+		print inst
+	
+while True:
+	#Timing Related ---start
+	_START_TIME = time.time()
+	_PREV_SLACK_TIME = _START_TIME - _END_TIME
+	#Timing Related ---end
+
+	#TASK CONTENT
+	a=numpy.random.random([1000,1000])
+	b=numpy.random.random([1000,1000])
+	c=numpy.mean(a*b)
+		
+	#Timing Related ---start
+	CreateTimingLog("../../logs/timing/dummy_load25_4_timing.inc")
+	#Timing Related ---end
+        
+	#Sleep
+	if(_PERIOD>_EXECUTION_TIME):
+		time.sleep(_PERIOD - _EXECUTION_TIME)
diff --git a/a4mcar/high_level_applications/apps/dummy_loads/dummy_load25_5.py b/a4mcar/high_level_applications/apps/dummy_loads/dummy_load25_5.py
new file mode 100644
index 0000000..09fcf9c
--- /dev/null
+++ b/a4mcar/high_level_applications/apps/dummy_loads/dummy_load25_5.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2017 Eclipse Foundation and FH Dortmund.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Description:
+#    A4MCAR Project - High-level Module Dummy Load roughly 25% on a core
+#
+# Author:
+#    M. Ozcelikors <mozcelikors@gmail.com>
+
+import psutil
+import time
+import string
+import numpy
+
+#Timing Related ---start
+_DEADLINE = 1.40
+_START_TIME = 0
+_END_TIME = 0
+_EXECUTION_TIME = 0                  
+_PREV_SLACK_TIME = 0
+_PERIOD = 1.40
+#Timing Related ---end
+
+def CreateTimingLog(filename):
+	global _START_TIME
+	global _DEADLINE
+	global _END_TIME
+	global _EXECUTION_TIME
+	global _PREV_SLACK_TIME
+	global _PERIOD
+        
+	try:
+		file_obj = open(str(filename), "w+r")
+	except Exception as inst:
+		print inst
+	_END_TIME = time.time()
+	_EXECUTION_TIME = _END_TIME - _START_TIME
+	try:
+		file_obj.write(str(_PREV_SLACK_TIME)+' '+str(_EXECUTION_TIME)+' '+str(_PERIOD)+' '+str(_DEADLINE))
+		file_obj.close()
+	except Exception as inst:
+		print inst
+	
+while True:
+	#Timing Related ---start
+	_START_TIME = time.time()
+	_PREV_SLACK_TIME = _START_TIME - _END_TIME
+	#Timing Related ---end
+
+	#TASK CONTENT
+	a=numpy.random.random([1000,1000])
+	b=numpy.random.random([1000,1000])
+	c=numpy.mean(a*b)
+		
+	#Timing Related ---start
+	CreateTimingLog("../../logs/timing/dummy_load25_5_timing.inc")
+	#Timing Related ---end
+        
+	#Sleep
+	if(_PERIOD>_EXECUTION_TIME):
+		time.sleep(_PERIOD - _EXECUTION_TIME)
diff --git a/a4mcar/high_level_applications/logs/timing/dummy_load100_timing.inc b/a4mcar/high_level_applications/logs/timing/dummy_load100_timing.inc
new file mode 100644
index 0000000..8390b52
--- /dev/null
+++ b/a4mcar/high_level_applications/logs/timing/dummy_load100_timing.inc
@@ -0,0 +1 @@
+0.0611069202423 0.483111143112 0.5 0.5
\ No newline at end of file
diff --git a/a4mcar/high_level_applications/logs/timing/dummy_load25_1_timing.inc b/a4mcar/high_level_applications/logs/timing/dummy_load25_1_timing.inc
new file mode 100644
index 0000000..abc8f13
--- /dev/null
+++ b/a4mcar/high_level_applications/logs/timing/dummy_load25_1_timing.inc
@@ -0,0 +1 @@
+0.957489967346 0.405393123627 1.4 1.4
\ No newline at end of file
diff --git a/a4mcar/high_level_applications/logs/timing/dummy_load25_2_timing.inc b/a4mcar/high_level_applications/logs/timing/dummy_load25_2_timing.inc
new file mode 100644
index 0000000..6b6aec9
--- /dev/null
+++ b/a4mcar/high_level_applications/logs/timing/dummy_load25_2_timing.inc
@@ -0,0 +1 @@
+0.808835983276 0.580476045609 1.4 1.4
\ No newline at end of file
diff --git a/a4mcar/high_level_applications/logs/timing/dummy_load25_3_timing.inc b/a4mcar/high_level_applications/logs/timing/dummy_load25_3_timing.inc
new file mode 100644
index 0000000..a3bf333
--- /dev/null
+++ b/a4mcar/high_level_applications/logs/timing/dummy_load25_3_timing.inc
@@ -0,0 +1 @@
+0.926493883133 0.533901929855 1.4 1.4
\ No newline at end of file
diff --git a/a4mcar/high_level_applications/logs/timing/dummy_load25_4_timing.inc b/a4mcar/high_level_applications/logs/timing/dummy_load25_4_timing.inc
new file mode 100644
index 0000000..3699c34
--- /dev/null
+++ b/a4mcar/high_level_applications/logs/timing/dummy_load25_4_timing.inc
@@ -0,0 +1 @@
+0.999537944794 0.402255058289 1.4 1.4
\ No newline at end of file
diff --git a/a4mcar/high_level_applications/logs/timing/dummy_load25_5_timing.inc b/a4mcar/high_level_applications/logs/timing/dummy_load25_5_timing.inc
new file mode 100644
index 0000000..ea4398e
--- /dev/null
+++ b/a4mcar/high_level_applications/logs/timing/dummy_load25_5_timing.inc
@@ -0,0 +1 @@
+0.986654996872 0.429600954056 1.4 1.4
\ No newline at end of file