Commit 20360d8f authored by CD's avatar CD
Browse files

Missed these Phys files

parent 54a7dd15
Error during dialog loading of C:/Users/SightH/ACT-R_Phi/environment/GUI/dialogs/25-event-queue.tcl: window name "event_queue_button" already exists in parent
Error during dialog loading of C:/Users/SightH/Research-Repos/ACT-R_Phi/environment/GUI/dialogs/25-event-queue.tcl: window name "event_queue_button" already exists in parent
communication error result:
\ No newline at end of file
# Port settings for ACT-R server started at 10:29:21 10/08/2020
set actr_port 2651
# Port settings for ACT-R server started at 21:23:33 10/12/2020
set actr_port 2654
set actr_address "192.168.1.118"
# Port settings for ACT-R server started at 21:23:52 10/07/2020
set actr_port 2663
set actr_address "192.168.1.118"
# Port settings for ACT-R server started at 21:23:52 10/07/2020
set actr_port 2660
set actr_address "192.168.1.118"
#----
# By Chris Dancy, Dept of Computer Science, Bucknell University
# Python functions to allow simple live graphing of Phys Variables (and perhaps others)
# Assumes file with 2 columns and each row separated by comma
# Used [https://pythonprogramming.net/live-graphs-matplotlib-tutorial/] for initial dev of this functionality
#----
import argparse
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import matplotlib.style as style
class PlotPhi:
def __init__(self, data_file_name):
self.data_file = data_file_name
def main_func(self):
style.use("fivethirtyeight")
self._fig = plt.figure()
self._ax1 = self._fig.add_subplot(1,1,1)
ani = animation.FuncAnimation(self._fig, self.animate, interval=1000)
plt.title(self.data_file)
plt.show()
def animate(self, i):
"""
Used to updaate our plot with new data at every interval
(interval decided by call to )
"""
data_file = open(self.data_file, "r")
graph_data = data_file.read()
rows = graph_data.split('\n')
xs = []
ys = []
for row in rows:
if (len(row) > 1):
(x, y) = row.split(",")
xs.append(float(x))
ys.append(float(y))
self._ax1.clear()
self._ax1.plot(xs, ys)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Plot ACT-R/Phi variables')
parser.add_argument('--data_file', type=str, default="../user-loads/save-phi-vals.txt", help='The name (and location) of the file that holds those data you wish to plot.')
args = parser.parse_args()
my_plot = PlotPhi(args.data_file)
my_plot.main_func()
<ini>
<windowtop> 197 </windowtop>
<windowleft> 263 </windowleft>
<windowhigh> 200 </windowhigh>
<windowtop> 270 </windowtop>
<windowleft> 283 </windowleft>
<windowhigh> 189 </windowhigh>
<windowwide> 377 </windowwide>
<windowstate> 0 </windowstate>
<pipeinterval> 10 </pipeinterval>
......
......@@ -344,7 +344,6 @@ t)
#+:ccl (ccl::current-directory-name)
#+:sbcl (sb-posix:getcwd)
)
(format t "~a~&" (concatenate 'string model hide-gui non-gui-version activity-timeout))
#+:ccl (ccl::cwd *HumModDir*)
#+:sbcl (sb-posix:chdir *HumModDir*)
(setf (phys-module-HProc phys)
......@@ -1104,13 +1103,24 @@ t)
(create-ics-from-out solver-out-file ics-out-file phys)))
#|---End Physiological Initial Condition Functions---|#
#|---Start Physiological data help functions---|#
;;;
;;;;Helpful functions for examining physiological data
(defun get-recorded-vals ()
(phys-module-vals-analysis (get-module physio)))
(defun output-phys-var (var-name &key (out-file-name "phys-var.txt") (phys (get-module physio)))
"Output physiological variable state (value) to given file
@param var-name: [string] Name of physiological variable who's value we will output
@key out-file-name: [string] name of output file
@key phys: Physiological module to use for output (our own physio by default)"
(let ((var-val (read-from-string (cadar (car (get-phys-vals nil (list (list var-name))))))))
(with-open-file
(out-file out-file-name
:direction :output :if-exists :append :if-does-not-exist :create)
(format out-file "~3$,~3$~&" (mp-time) var-val))))
#|---End Physiological data help functions---|#
;;;
;;;;;ACT-R Module Section
(defstruct phys-module
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment