Commit 6b255044 authored by CD's avatar CD
Browse files

Some trys at updating for ACT-R7, problem with find-last-event-time

parent cdf0cc86
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
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/Phys-Cog/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 21:18:46 6/18/2019
set actr_port 2650
set actr_address "192.168.1.78"
# Port settings for ACT-R server started at 14:43:05 8/02/2019
set actr_port 2652
set actr_address "130.203.161.104"
......@@ -4,7 +4,7 @@
wm deiconify .
update
wm withdraw .
if {[winfo screenwidth .] != 3440 || [winfo screenheight .] != 1440 || [lindex [wm maxsize .] 0] != 3444 || [lindex [wm maxsize .] 1] != 1421} {
if {[winfo screenwidth .] != 1920 || [winfo screenheight .] != 1080 || [lindex [wm maxsize .] 0] != 1924 || [lindex [wm maxsize .] 1] != 1055} {
set size_mismatch 1
} else {
set size_mismatch 0
......@@ -15,14 +15,12 @@ if $size_mismatch {
-message "The screen resolution is not the same as it was the last time the Environment was used. Should the window positions reset to the defaults?"]
} else { set reset_window_sizes 0}
if {$reset_window_sizes != "yes"} {
set window_config(.audicon) 870x150+525+440
set changed_window_list(.audicon) 1
set window_config(.visicon) 1920x1001+610+440
set changed_window_list(.visicon) 1
set window_config(.control_panel) 235x700+1665+190
set changed_window_list(.control_panel) 1
set window_config(.buffers) 350x240+785+420
set changed_window_list(.buffers) 1
set window_config(.options) 450x274+735+403
set changed_window_list(.options) 1
set window_config(.copyright) 400x290+760+395
set changed_window_list(.copyright) 1
}
set gui_options(p_selected) #44DA22
set gui_options(p_matched) #FCA31D
......
# this file generated from saving the options
set options_array(show_copyrights) 1
set options_array(use_env_window) true
set options_array(use_smart_load) false
set options_array(show_copyrights) 0
set options_array(kill_model_windows) 1
set options_array(save_backups) 1
set options_array(use_smart_load) false
set options_array(save_before_reload) 1
set options_array(save_backups) 1
......@@ -2635,7 +2635,6 @@ Goes to 'active' listener:
(add-act-r-command "act-r-version" 'act-r-version-string "Returns the current ACT-R version string. No params." nil)
;;; Actually echo the output by default now if it's not the standalone.
#-:standalone (echo-act-r-output)
......
require(ggplot2)
require(reshape2)
get_arousal_noise = function(id)
{
theme_update(plot.title = element_text(hjust = 0.5))
ArousalANS.mat = read.csv(paste0("C:/Users/Phys-Cog/ACT-R_Phi/arous-ans-log", id, ".txt"), header=FALSE)
CECArousal.mat = read.csv(paste0("C:/Users/Phys-Cog/ACT-R_Phi/CEC-Arous", id, ".txt"))
CECArousal.mat = cbind(matrix(1:1798, 1798, 1), CECArousal.mat)
CECArousalANS.mat = CECArousal.mat
colnames(CECArousalANS.mat)[1] = "Time"
CECArousalANS.mat = cbind(CECArousalANS.mat, ArousalANS.mat[1:1798,3])
colnames(CECArousalANS.mat)[6] = "Noise"
CECArousalANSLong.mat = melt(CECArousalANS.mat, id="Time")
CECArousalANSLong.plot = ggplot(as.data.frame(CECArousalANSLong.mat))
fac_names = c(
`f.Cortisol.` = "f(cortisol)",
`g.Epinephrine.` = "g(epinephrine)",
`h.CRH.` = "h(crh)",
`Arousal` = "arousal",
`Noise` = "noise"
)
CECArousalANSLong.plot + geom_line(aes(x=Time, y=value, color=variable), size=0.5) +
labs(y="Normalized Effect (1 is a \"normal\" level)", x="Time (s)", title="Effects of stress physiology on arousal") +
facet_grid(variable~., scales = "free_y", labeller = as_labeller(fac_names))
}
\ No newline at end of file
(clear-all)
(defun run-test-model (run-time)
;;Schedule event to change physiology
;(schedule-event 0.022 'set-phys-vals :module 'physio :params (list (list (list "IVDrip.Switch" 1) (list "IVDrip.H2OSetting" 25) (list "IVDrip.ClinicalSaline" 860))) :priority :max :details "Start hypertonic saline IV")
(schedule-periodic-event 1 'test-record-arousal
:initial-delay 2 :module :physio :output nil)
(sgp :phys-ics-exp-file "ICS/Racinais-2008_Hot.ICS")
(run run-time))
(defun run-graded-stress1 (&optional (length 20) (perc-inc 100) (num-steps 20))
"Runs stress in a graded manner w/ instant CRF stress reaction
(i.e., slowly increases, the decreases, activation of physiological systems)
Inputs:
length - time to run incerase and decrease in minutes (int)
perc-inc - percent of maximum to increase (double 0-100)
num-steps - number of steps to increase from base to percentage of max"
(let* ((num-steps-side (ceiling (/ num-steps 2)))
(perc-per (/ (/ perc-inc num-steps-side) 100))
(time-per (/ length num-steps))
(END-SYMP-ACT 1))
(sgp :AA-max-arous 3)
(schedule-periodic-event 1 'test-record-arousal
:module :physio :output nil :initial-delay 2)
;Affect epinephrine/adrenaline & CRF
(schedule-event-relative 0.020 'set-phys-vals :module 'physio
:params (list (list (list "Sympathetics-Adrenal.ClampLevel" 2)
(list "Sympathetics-Adrenal.ClampSwitch" 1)
(list "CorticotropinReleasingFactor.Stress" 4)))
:priority :max :details "Graded stress increase adrenal & CRF")
(dotimes (i num-steps-side)
(let* ((step (+ i 1))
(symp-act (* perc-per step END-SYMP-ACT)))
;General sympathetic arousal
(schedule-event-relative 0.021 'set-phys-vals :module 'physio
:params (list (list (list "Sympathetics-General.EssentialEffect" symp-act)))
:priority :max :details "Graded stress increase Symp Essential")
(run (* time-per 60))))
;;Now move stress back towards normal (adrenaline & CRF)
(schedule-event-relative 0.020 'set-phys-vals :module 'physio
:params (list (list (list "Sympathetics-Adrenal.ClampSwitch" 0)
(list "CorticotropinReleasingFactor.Stress" 2)))
:priority :max :details "Graded stress reduction adrenal & CRF")
(dotimes (i num-steps-side)
(let* ((step (+ i 1))
(symp-act (* perc-per step END-SYMP-ACT)))
(if (> symp-act END-SYMP-ACT) (setf symp-act END-SYMP-ACT))
(format t "Sleep ~a ~a ~a~%" perc-per step symp-act)
;General sympathetic arousal
(schedule-event-relative 0.021 'set-phys-vals :module 'physio
:params (list (list (list "Sympathetics-General.EssentialEffect" (- END-SYMP-ACT symp-act))))
:priority :max :details "Graded stress reduction symp essential")
(run (* time-per 60))))))
(defun run-graded-stress2 (&optional (length 20) (perc-inc 100) (num-steps 20))
"Runs stress in a graded manner w/ graded CRF stress reaction
(i.e., slowly increases, the decreases, activation of physiological systems)
Inputs:
length - time to run incerase and decrease in minutes (int)
perc-inc - percent of maximum to increase (double 0-100)
num-steps - number of steps to increase from base to percentage of max"
(let* ((num-steps-side (ceiling (/ num-steps 2)))
(perc-per (/ (/ perc-inc num-steps-side) 100))
(time-per (/ length num-steps))
(END-SYMP-ACT 1)
(crh2 nil)
(crh4 nil))
(schedule-periodic-event 1 'test-record-arousal
:module :physio :output nil :initial-delay 2)
;Affect epinephrine/adrenaline
(schedule-event-relative 0.020 'set-phys-vals :module 'physio
:params (list (list (list "Sympathetics-Adrenal.ClampLevel" 2)
(list "Sympathetics-Adrenal.ClampSwitch" 1)))
:priority :max :details "Graded stress")
(dotimes (i num-steps-side)
(let* ((step (+ i 1))
(symp-act (* perc-per step END-SYMP-ACT)))
;General sympathetic arousal
(schedule-event-relative 0.021 'set-phys-vals :module 'physio
:params (list (list (list "Sympathetics-General.EssentialEffect" symp-act)))
:priority :max :details "Graded stress")
;Increase CRH-based stress
(if (and (not crh2) (> (* step time-per) (* length 0.375)))
(progn
(setf crh2 t)
(schedule-event-relative 0.022 'set-phys-vals :module 'physio
:params (list (list (list "CorticotropinReleasingFactor.Stress" 4)))
:priority :max :details "Graded stress"))
(if (and (not crh4) (> (* step time-per) (* length 0.125)))
(progn
(setf crh4 t)
(schedule-event-relative 0.022 'set-phys-vals :module 'physio
:params (list (list (list "CorticotropinReleasingFactor.Stress" 3)))
:priority :max :details "Graded stress"))))
(run (* time-per 60))))
;;Now move stress back towards normal
(schedule-event-relative 0.020 'set-phys-vals :module 'physio
:params (list (list (list "Sympathetics-Adrenal.ClampSwitch" 0)))
:priority :max :details "Graded stress reduction Adrenal")
(setf crh2 nil)
(setf crh4 nil)
(dotimes (i num-steps-side)
(let* ((step (+ i 1))
(symp-act (* perc-per step END-SYMP-ACT)))
(if (> symp-act END-SYMP-ACT) (setf symp-act END-SYMP-ACT))
;General sympathetic arousal
(schedule-event-relative 0.021 'set-phys-vals :module 'physio
:params (list (list (list "Sympathetics-General.EssentialEffect" (- END-SYMP-ACT symp-act))))
:priority :max :details "Graded stress reduction Symp Essential")
;Increase CRH-based stress
(if (and (not crh2) (> (* step time-per) (* length 0.375)))
(progn
(setf crh2 t)
(schedule-event-relative 0.022 'set-phys-vals :module 'physio
:params (list (list (list "CorticotropinReleasingFactor.Stress" 2)))
:priority :max :details "Graded stress reduction CRF"))
(if (and (not crh4) (> (* step time-per) (* length 0.125)))
(progn
(setf crh4 t)
(schedule-event-relative 0.022 'set-phys-vals :module 'physio
:params (list (list (list "CorticotropinReleasingFactor.Stress" 3)))
:priority :max :details "Graded stress reduction"))))
(run (* time-per 60))))))
(defun test-record-arousal ()
(let* ((aa (get-module Affective-Associations))
(arous-dm-noise (compute-arousal-factor (AA-pred-error-factor aa) t))
(arous-mid (/ (AA-max-arous aa) 2))
(noise-val 0))
(when (= arous-dm-noise 0) (incf arous-dm-noise 0.000001))
(if (<= arous-dm-noise arous-mid)
(setf noise-val (/ (+ (* arous-dm-noise (AA-nom-dm-noise aa)) (* (- arous-mid arous-dm-noise) (AA-max-dm-noise aa))) arous-mid))
(setf noise-val (/ (+ (* (- (AA-max-arous aa) arous-dm-noise) (AA-nom-dm-noise aa)) (* (- arous-dm-noise arous-mid) (AA-max-dm-noise aa))) arous-mid)))
(with-open-file
(n-stream (concatenate 'string "arous-ans-log" *START-TIME* ".txt") :direction :output :if-exists :append :if-does-not-exist :create)
(format n-stream "~0$,~5$,~5$~&" (mp-time) arous-dm-noise noise-val))))
(define-model ACT-Phi2_Test1
(sgp :esc t :lf .05 :trace-detail high)
(sgp :phys-delay 2 :phys-enabled t);:recorded-phys ("OsmBody.[Osm(mOsm/L)]-CellWall"))
(sgp :AA-enabled t)
(sgp :AA-dm-noise-switch t)
(sgp :AA-util-noise-switch nil)
;(sgp :AA-chunk-arousal-switch nil)
(sgp :AA-max-dm-noise 1)
(chunk-type chunk1 myslot1)
(chunk-type chunk2 myslot2)
(chunk-type goal-chunk goal-slot)
(add-dm (blah1 isa chunk1 myslot1 2) (blah2 isa chunk2 myslot2 1) (goal1 isa goal-chunk goal-slot 1) (goal2 isa goal-chunk goal-slot 2))
(p rule1
=goal>
isa goal-chunk
goal-slot =num
?imaginal>
state free
==>
=goal>
goal-slot 2
+imaginal>
isa chunk1
myslot1 =num)
(p rule2
=goal>
isa goal-chunk
goal-slot 2
=imaginal>
isa chunk1
==>
=goal>
goal-slot 1)
(goal-focus goal1))
sampleEpi = seq(39, 80, 0.1)
(32.8-24)/411
sampleCort = seq(20.4,32.8,0.02)
sampleCort = seq(24,32.8,0.02)
sampleCort = seq(24,32.8,0.021)
sampleCort = seq(24,32.8,0.0214)
sampleCort = seq(24,32.8,0.02141)
sampleCort = seq(24,32.8,0.021411)
sampleCort = seq(24,32.8,0.021411)
sampleCort = seq(24,32.8,0.0214111)
sampleCort = seq(24,32.8,0.02141119)
sampleCort = seq(24,32.8,0.0214)
sampleCort = seq(24,32.8,0.021)
sampleCort = seq(24,32.8,0.0215)
sampleCort = seq(24,32.8,0.0214)
sampleCort = seq(24,32.8,0.02142)
(189-81)/411
sampleCRH = seq(81,189,0.2627737)
sampleCRH = seq(81,189,0.262773)
sampleCRH = seq(81,189,0.262)
sampleCRH = seq(81,189,0.263)
save.image("C:/Users/Phys-Cog/Dropbox/MyPubs/ACT-RPhi/Data/Eqns.RData")
cortMax = matrix(nrow=411, ncol=2)
cortMat = matrix(nrow=411, ncol=2)
remove(cortMax)
crhMat = matrix(nrow=411, ncol=2)
epiMat = matrix(nrow=411, ncol=2)
epiMat = matrix(2, nrow=411, ncol=2)
crhMat = matrix(2, nrow=411, ncol=2)
cortMat = matrix(2, nrow=411, ncol=2)
arousalMat = matrix(2, nrow=411, ncol=2)
save.image("C:/Users/Phys-Cog/Dropbox/MyPubs/ACT-RPhi/Data/Eqns.RData")
arousalMat = matrix(4, nrow=411, ncol=2)
crhMat[1,]
crhMat[,1]
crhMat[,1] = sampleCRH[,]
crhMat[,1] = sampleCRH[,]1
crhMat[,1] = sampleCRH[,1]
crhMat[,1] = sampleCRH[1,]
crhMat[,1] = sampleCRH
epiMat[,1] = sampleEpi
cortMat[,1] = sampleCort
cortMat[,2] = (cortMat[,1])
cortMat[,2] = (cortMat[,1]-cortMat[1,1])
cortMat[,2] = (cortMat[,1]-cortMat[1,1])/(0.75 * (cortMat[length(cortMat[,1]),1] - cortMat[1,1]))
View(cortMat)
epiMat[,2] = epiMat[,1]/epiMat[1,1]
CRHMat[,2] = crhMat[,1]/crhMat[1,1]
crhMat[,2] = crhMat[,1]/crhMat[1,1]
View(arousalMat)
View(arousalMat)
plot(arousalMat)
plot(arousalMat[,1], arousalMat[,2])
install.packages("ggplot2")
library("ggplot2", lib.loc="~/R/win-library/3.4")
crhPlot = ggplot(crhMat)
crhPlot = ggplot(as.dataframe(crhMat))
crhPlot = ggplot(as.data.frame(crhMat))
as.matrix(crhMat)
crhDF = as.data.frame(crhMat)
View(crhDF)
crhPlot + geom_line(aes(x=V1,y=V2))
save.image("C:/Users/Phys-Cog/Dropbox/MyPubs/ACT-RPhi/Data/Eqns.RData")
arousalMat[,1] = seq(1,411,1)
arousalMat[,2] = cortMat[,2] * (0.5*(epiMat[,2] + cortMat[,2]))
View(arousalMat)
View(arousalMat)
cortMat[,2] = (cortMat[,1]/cortMat[1,1])
arousalMat[,2] = cortMat[,2] * (0.5*(epiMat[,2] + cortMat[,2]))
test = read.csv("C:\Users\Phys-Cog\Dropbox\MyPubs\ACT-RPhi\Sample_Stress_Phys.csv")
test = read.csv("C:/Users/Phys-Cog/Dropbox/MyPubs/ACT-RPhi/Sample_Stress_Phys.csv")
View(test)
stressPhysVars = test
remove(test)
save.image("C:/Users/Phys-Cog/Dropbox/MyPubs/ACT-RPhi/Data/Eqns.RData")
433*4
stressPhysVars[1,]
stressPhysVars[,1] = stressPhysVars[.1] + 1
View(stressPhysVars)
stressPhysVars[0,]
stressPhysVars[1,]
stressPhysVars[,0]
stressPhysVars[,1]
arousalMat[,2] = stressPhysVars[,3] * (0.5*(stressPhysVars[,2] + stressPhysVars[,1]))
arousalMat = matrix(nrow=991,2)
arousalMat[,1] = seq(1,991)
arousalMat[,2] = stressPhysVars[,3] * (0.5*(stressPhysVars[,2] + stressPhysVars[,1]))
arousalMat = matrix(nrow=991,ncol=2)
arousalMat[,1] = seq(1,991)
arousalMat[,2] = stressPhysVars[,3] * (0.5*(stressPhysVars[,2] + stressPhysVars[,1]))
View(arousalMat)
crh\Mat = matrix(nrow=991,ncol=2)
crhMat = matrix(nrow=991,ncol=2)
epiMat = matrix(nrow=991,ncol=2)
cortMat = matrix(nrow=991,ncol=2)
crhMat[,1] = stressPhysVars[,2]
epiMat[,1] = stressPhysVars[,1]
cortMat[,1] = stressPhysVars[,3]
cortMat[,2] = (cortMat[,1]/24)
crhMat[,2] = (crhMat[,1]/81)
epiMat[,2] = (epiMat[,1]/39)
save.image("C:/Users/Phys-Cog/Dropbox/MyPubs/ACT-RPhi/Data/Eqns.RData")
View(cortMat)
View(crhMat)
arousalMat[,2] = cortMat[,2] * (0.5 * (crhMat[,2] + epiMat[,2]))
cortMat[,2] = (cortMat[,1] - 24) / (0.75 * (cortMat[length(cortMat[,1]),1] - 24))
arousalMat[,2] = stressPhysVars[,3] * (0.5*(stressPhysVars[,2] + stressPhysVars[,1]))
arousalMat[,2] = cortMat[,2] * (0.5 * (crhMat[,2] + epiMat[,2]))
cortMat[,2] = (cortMat[,1]/24)
arousalMat[,2] = cortMat[,2] * (0.5 * (crhMat[,2] + epiMat[,2]))
arousalMat[,2] = cortMat[,2] * (0.25 * (crhMat[,2] + epiMat[,2]))
arousalMat[,2] = cortMat[,2] * (0.25 * (crhMat[,2] + epiMat[,2]))
arousalMat[,2] = cortMat[,2] * (0.5 * (crhMat[,2] + epiMat[,2]))
corMatInit = matrix(ncol=1000,nrow=2)
crhMatInit = matrix(ncol=1000,nrow=2)
epiMatInit = matrix(ncol=1000,nrow=2)
corMatInit = matrix(ncol=1200,nrow=2)
epiMatInit = matrix(ncol=1200,nrow=2)
crhMatInit = matrix(ncol=1200,nrow=2)
View(cortMat)
corMatInit[1:209,] = seq(24, 24.5, length.out=209)
blah = seq(24, 24.5, length.out=209)
corMatInit[1:209,2] = seq(24, 24.5, length.out=209)
corMatInit[1:209,] = blah
length(blah)
length(corMatInit[1:209,])
corMatInit = matrix(nrow=1200,ncol=2)
crhMatInit = matrix(nrow=1200,ncol=2)
epiMatInit = matrix(nrow=1200,ncol=2)
corMatInit[1:209,2] = seq(24, 24.5, length.out=209)
crhMatInit[1:209,2] = seq(81,342.9,length.out=209)
View(epiMat)
epiMatInit[1:209,2] = seq(39,39,length.out=209)
epiMatInit[1:209,2] = seq(39,39.161,length.out=209)
corMatInit[210:length(corMatInit[,1]),2] = corMat
corMatInit[210:length(corMatInit[,1]),2] = corMat[,2]
corMatInit[210:length(corMatInit[,1]),2] = cortMat[,2]
epiMatInit[210:1200,2] = epiMat[,2]
crhMatInit[210:1200,2] = crhMat[,2]
View(crhMatInit)
View(corMatInit)
cortMatInit = corMatInit
remove(corMatInit)
cortMatInit[,1] = cortMatInit[,2]
epiMatInit[,1] = epiMatInit[,2]
crhMatInit[,1] = crhMatInit[,2]
cortMatInit[,2] = (cortMatInit[,1]/24)
epiMatInit[,2] = (epiMatInit[,1]/39)
crhMatInit[,2] = (crhMatInit[,1]/81)
View(epiMatInit)
View(epiMatInit)
epiMatInit[210:1200,1] = (epiMat[,1])
crhMatInit[210:1200,1] = (crhMat[,1])
cortMatInit[210:1200,1] = (cortMat[,1])
cortMatInit[,2] = (cortMatInit[,1]/24)
epiMatInit[,2] = (epiMatInit[,1]/39)
crhMatInit[,2] = (crhMatInit[,1]/81)
save.image("C:/Users/Phys-Cog/Dropbox/MyPubs/ACT-RPhi/Data/Eqns.RData")
crhPlot = ggplot(as.data.frame(crhMatInit))
crhPlot + geom_line(aes(x=V1,y=V2))
arousalMat = matrix(ncol=2,nrow=1200)
arousalMat[,2] = cortMat[,2] * ((0.25 * crhMat[,2]) + (0.5 * epiMat[,2]))
arousalMat[,2] = cortMatInit[,2] * ((0.25 * crhMatInit[,2]) + (0.5 * epiMatInit[,2]))
arousalMat[,1] = seq(1,1200,1)
epiPlot = ggplot(as.data.frame(epiMatInit))
epiPlot + geom_line(aes(x=V1,y=V2))
epiPlot + geom_line(aes(y=V2))
epiMat = matrix(ncol=1200,nrow=3)
crhMat = matrix(ncol=1200,nrow=3)
cortMat= matrix(ncol=1200,nrow=3)
epiMat[,1] = seq(1,1200)
epiMat[,1] = seq(1,1200,1)
epiMat = matrix(ncol=1200,nrow=3)
epiMat = matrix(nrow=1200,ncol=3)
crhMat = matrix(nrow=1200,ncol=3)
cortMat = matrix(nrow=1200,ncol=3)
epiMat[,1] = seq(1,1200,1)
cortMat[,1] = seq(1,1200,1)
crhMat[,1] = seq(1,1200,1)
epiMat[,2:3] = epiMatInit
cortMat[,2:3] = cortMatInit
crhMat[,2:3] = crhMatInit
epiPlot = ggplot(as.data.frame(epiMatInit))
epiPlot + geom_line(aes(x=V1,y=V3))
blah = as.data.frame(epiMatInit)
View(blah)
epiPlot = ggplot(as.data.frame(epiMat))
epiPlot + geom_line(aes(x=V1,y=V3))
crhPlot = ggplot(as.data.frame(crhMat))
crhPlot + geom_line(aes(x=V1,y=V3))
cortPlot = ggplot(as.data.frame(cortMat))
cortPlot + geom_line(aes(x=V1,y=V3))
arousalPlot = ggplot(as.data.frame(arousalMat))
arousalPlot + geom_line(aes(x=V1,y=V2))
length(arousalMat[,2] > 1)
length((arousalMat[,2] > 1) == 1)
length(arousalMat[arousalMat[,2] > 1,2])
dmNoiseMat = matrix(nrow=1200,ncol=3)
dmNoiseMat = arousalMat[arousalMat[,2] > 1,2]
dmNoiseMat = matrix(nrow=1200,ncol=3)
dmNoiseMat[,1:2] = arousalMat
arousalOverOne = arousalMat[arousalMat[,2] > 1,2]
abs(-2)
dmNoiseMat[64:1200,3] = ((abs(2 - arousalOverOne) * 0.01) + ((arousalOverOne - 1) * 2) / 1
)
dmNoiseMat[64:1200,3] = ((abs(2 - arousalOverOne) * 0.01) + ((arousalOverOne - 1) * 2)) / 1
dmNoiseMat[1:63,3] = ( ((arousalMat[1:63,2] * 0.01) + ((1 - arousalMat[1:63,2]) * 2)) / 1)
save.image("C:/Users/Phys-Cog/Dropbox/MyPubs/ACT-RPhi/Data/Eqns.RData")
View(dmNoiseMat)
dmNoiseMat[64:1200,3] = ((abs(2 - arousalOverOne) * 0.01) + ((arousalOverOne - 1) * 0.7)) / 1
dmNoiseMat[1:63,3] = ( ((arousalMat[1:63,2] * 0.01) + ((1 - arousalMat[1:63,2]) * 0.7)) / 1)
save.image("C:/Users/Phys-Cog/Dropbox/MyPubs/ACT-RPhi/Data/Eqns.RData")
dmNoisePlot = ggplot(as.data.frame(dmNoiseMat))
dmNoisePlot + geom_line(aes(x=V1,y=V3))
save.image("C:/Users/Phys-Cog/Dropbox/MyPubs/ACT-RPhi/Data/Eqns.RData")
test = read.csv("C:\Users\Phys-Cog\Dropbox\MyPubs\ACT-RPhi\Sample_Stress_Phys.csv")
test = read.csv("C:/Users/Phys-Cog/Dropbox/MyPubs/ACT-RPhi/Sample_Stress_Phys.csv")
stressPhysVars2 = test
View(stressPhysVars2)
stressPhysVars2[,1] = stressPhysVars2[,1]+1
stressPhysVars2 = read.csv("C:/Users/Phys-Cog/Dropbox/MyPubs/ACT-RPhi/Sample_Stress_Phys.csv")
stressPhysVars2[,1] = stressPhysVars2[,1]+1
arousalMat2[,2] = stressPhysVars2[,4] * ((0.25*(stressPhysVars[,3]) + (0.5*stressPhysVars[,2])))
arousalMat2[]
arousalMat2 = matrix(ncol=2,nrow=991)
arousalMat2[,1] = seq(1,991,1)
arousalMat2[,2] = stressPhysVars2[,4] * ((0.25*(stressPhysVars[,3]) + (0.5*stressPhysVars[,2])))
View(arousalMat2)
crhMat2 = matrix(nrow=991,ncol=2)
cortMat2 = matrix(nrow=991,ncol=2)
epiMat2 = matrix(nrow=991,ncol=2)
cortMat2[,2] = (cortMat2[,1]/24)
epiMat2[,2] = (epiMat2[,1]/39)
crhMat2[,2] = (crhMat2[,1]/81)
arousalMat2[,2] = cortMat2[,2] * ((0.25*(crhMat2[,2]) + (0.5*epiMat2[,2])))
View(cortMat2)
cortMat2[,1] = stressPhysVars2[,4]
epiMat2[,1] = stressPhysVars2[,2]
crhMat2[,1] = stressPhysVars2[,3]
cortMat2[,1] = stressPhysVars2[,4]
cortMat2[,2] = (cortMat2[,1]/24)
crhMat2[,2] = (crhMat2[,1]/81)
epiMat2[,2] = (epiMat2[,1]/39)
arousalMat2[,2] = cortMat2[,2] * ((0.25*(crhMat2[,2]) + (0.5*epiMat2[,2])))
arousalMat2[,2] = cortMat2[,2] * ((0.5*(crhMat2[,2]) + (0.5*epiMat2[,2])))
arousalMat2[,2] = cortMat2[,2] * ((0.25*(crhMat2[,2]) + (0.5*epiMat2[,2])))
stressPhysVars2 = read.csv("C:/Users/Phys-Cog/Dropbox/MyPubs/ACT-RPhi/Sample_Stress_Phys.csv")
stressPhysVars2[,1] = stressPhysVars2[,1]+1
stressPhysVars2 = read.csv("C:/Users/Phys-Cog/Dropbox/MyPubs/ACT-RPhi/Sample_Stress_Phys.csv")
stressPhysVars2[,1] = stressPhysVars2[,1]+1
cortMat2 = matrix(nrow=1991, ncol=2)
crhMat2 = matrix(nrow=1991, ncol=2)
epiMat2 = matrix(nrow=1991, ncol=2)
epiMat2[1:991,1] = stressPhysVars2[1:991,2]
cortMat2[1:991,1] = stressPhysVars2[1:991,4]
crhMat2[1:991,1] = stressPhysVars2[1:991,3]
epiMat2[992:1991,1] = stressPhysVars2[,5]
cortMat2[992:1991,1] = stressPhysVars2[,7]
crhMat2[992:1991,1] = stressPhysVars2[,6]
cortMat2[,2] = (cortMat2[,1]/24)
crhMat2[,2] = (crhMat2[,1]/81)
epiMat2[,2] = (epiMat2[,1]/39)
arousalMat2 = matrix(nrow=1991, ncol=2)
arousalMat2[,2] = cortMat2[,2] * ((0.25*(crhMat2[,2]) + (0.5*epiMat2[,2])))
arousalMat2[,1] = seq(1,1991,1)
dmNoiseMat = matrix(nrow=1991,ncol=3)
dmNoiseMat[,1] = seq(1,1991,1)
dmNoiseMat[,2] = arousalMat2[,2]
dmNoiseMat[dmNoiseMat[,2] >= 1,3] = ((abs(2 - arousalOverOne) * 0.01) + ((arousalOverOne - 1) * 0.7)) / 1
arousalOverOne = dmNoiseMat[dmNoiseMat[,2] >= 1,2]
arousalUnderOne = dmNoiseMat[dmNoiseMat[,2] < 1,2]
dmNoiseMat[dmNoiseMat[,2] >= 1,3] = ((abs(2 - arousalOverOne) * 0.01) + ((arousalOverOne - 1) * 0.7)) / 1
dmNoiseMat[dmNoiseMat[,2] < 1,3] = ( ((arousalUnderOne * 0.01) + ((1 - arousalUnderOne) * 0.7)) / 1)
dmNoisePlot = ggplot(as.data.frame(dmNoiseMat))
dmNoisePlot + geom_line(aes(x=V1,y=V3))
dmNoiseMat[dmNoiseMat[,2] >= 1,3] = ((abs(1.7 - arousalOverOne) * 0.01) + ((arousalOverOne - 1) * 0.7)) / 1
dmNoisePlot = ggplot(as.data.frame(dmNoiseMat))
dmNoisePlot + geom_line(aes(x=V1,y=V3))
View(dmNoiseMat[dmNoiseMat[,2] >= 1,2])
dmNoiseMat[dmNoiseMat[,2] >= 1,3] = ((abs(2 - dmNoiseMat[dmNoiseMat[,2] >= 1,2]) * 0.01) + ((dmNoiseMat[dmNoiseMat[,2] >= 1,3] - 1) * 0.7)) / 1
dmNoiseMat[dmNoiseMat[,2] >= 1,3] = ((abs(2 - dmNoiseMat[dmNoiseMat[,2] >= 1,2]) * 0.01) + ((dmNoiseMat[dmNoiseMat[,2] >= 1,2] - 1) * 0.7)) / 1
dmNoiseMat[dmNoiseMat[,2] < 1,3] = ( ((dmNoiseMat[dmNoiseMat[,2] < 1,2] * 0.01) + ((1 - dmNoiseMat[dmNoiseMat[,2] < 1,2]) * 0.7)) / 1)
dmNoisePlot = ggplot(as.data.frame(dmNoiseMat))
dmNoisePlot + geom_line(aes(x=V1,y=V3))
dmNoiseMat[dmNoiseMat[,2] >= 1,3] = ((abs(1.7 - dmNoiseMat[dmNoiseMat[,2] >= 1,2]) * 0.01) + ((dmNoiseMat[dmNoiseMat[,2] >= 1,2] - 0.85) * 0.7)) / 0.85
dmNoiseMat[dmNoiseMat[,2] < 1,3] = ( ((dmNoiseMat[dmNoiseMat[,2] < 1,2] * 0.01) + ((0.85 - dmNoiseMat[dmNoiseMat[,2] < 1,2]) * 0.7)) / 0.85)
dmNoisePlot = ggplot(as.data.frame(dmNoiseMat))
dmNoisePlot + geom_line(aes(x=V1,y=V3))
dmNoiseMat[dmNoiseMat[,2] >= 0.85,3] = ((abs(1.7 - dmNoiseMat[dmNoiseMat[,2] >= 0.85,2]) * 0.01) + ((dmNoiseMat[dmNoiseMat[,2] >= 0.85,2] - 0.85) * 0.7)) / 0.85
dmNoiseMat[dmNoiseMat[,2] < 0.85,3] = ( ((dmNoiseMat[dmNoiseMat[,2] < 0.85,2] * 0.01) + ((0.85 - dmNoiseMat[dmNoiseMat[,2] < 0.85,2]) * 0.7)) / 0.85)
dmNoisePlot = ggplot(as.data.frame(dmNoiseMat))
dmNoisePlot + geom_line(aes(x=V1,y=V3))
arousalMat2[,2] = cortMat2[,2] * ((0.5*(crhMat2[,2]) + (0.5*epiMat2[,2])))
arousalMat2[,2] = cortMat2[,2] * ((0.25*(crhMat2[,2]) + (0.5*epiMat2[,2])))
dmNoisePlot = ggplot(as.data.frame(dmNoiseMat))
dmNoisePlot + geom_line(aes(x=V2,y=V3))
dmNoisePlot + geom_line(aes(x=V1,y=V3))
dmNoisePlot + geom_line(aes(x=V1,y=V3)) + geom_line(aes(x=V1, y=V2))\
dmNoisePlot + geom_line(aes(x=V1,y=V3)) + geom_line(aes(x=V1, y=V2))
dmNoisePlot + geom_line(aes(y=V3, color="V3") + geom_line(aes(y=V2, color="V3"))
)
dmNoisePlot + geom_line(aes(y=V3, color="V3")) + geom_line(aes(y=V2, color="V3"))
dmNoisePlot + geom_line(aes(x=V1, y=V3, color="V3")) + geom_line(aes(x=V1, y=V2, color="V3"))
stressPhysVars2 = read.csv("C:/Users/Phys-Cog/Dropbox/MyPubs/ACT-RPhi/Sample_Stress_Phys.csv")
stressPhysVars2[,1] = stressPhysVars2[,1]+1
crhMat2[1:991,1] = stressPhysVars2[1:991,3]
cortMat2[1:991,1] = stressPhysVars2[1:991,4]
epiMat2[1:991,1] = stressPhysVars2[1:991,2]
cortMat2[,2] = (cortMat2[,1]/24)
crhMat2[,2] = (crhMat2[,1]/81)
arousalMat2[,2] = cortMat2[,2] * ((0.25*(crhMat2[,2]) + (0.5*epiMat2[,2])))
dmNoiseMat[dmNoiseMat[,2] >= 1,3] = ((abs(1.7 - dmNoiseMat[dmNoiseMat[,2] >= 1,2]) * 0.01) + ((dmNoiseMat[dmNoiseMat[,2] >= 1,2] - 0.85) * 0.7)) / 0.85
dmNoiseMat[dmNoiseMat[,2] < 1,3] = ( ((dmNoiseMat[dmNoiseMat[,2] < 1,2] * 0.01) + ((1 - dmNoiseMat[dmNoiseMat[,2] < 1,2]) * 0.7)) / 1)
dmNoisePlot = ggplot(as.data.frame(dmNoiseMat))
dmNoisePlot + geom_line(aes(x=V1, y=V3, color="V3")) + geom_line(aes(x=V1, y=V2, color="V3"))
save.image("C:/Users/Phys-Cog/Dropbox/MyPubs/ACT-RPhi/Data/Eqns.RData")
View(crhDF)
View(crhMat2)
View(epiMat2)
dmNoisePlot + geom_line(aes(x=V1, y=V3, color="Blue")) + geom_line(aes(x=V1, y=V2, color="Red"))
dmNoisePlot + geom_line(aes(x=V1, y=V3, color="Blue", linetype="a")) + geom_line(aes(x=V1, y=V2, color="Red", linetype="b"))
View(cortMat2)
save.image("C:/Users/Phys-Cog/Dropbox/MyPubs/ACT-RPhi/Data/Eqns.RData")
CEC-ArousalMat = read.csv("C:/Users/Phys-Cog/Dropbox/MyPubs/ACT-RPhi/CEC-Arous13556000.txt")
CEC-ArousalMat = read.csv("C:/Users/Phys-Cog/ACT-R_Phi/CEC-Arous13556000.txt")
CEC-ArousalMat = read.csv("C:/Users/Phys-Cog/ACT-R_Phi/CEC\-Arous13556000.txt")
CEC-ArousalMat = read.csv("C:/Users/Phys-Cog/ACT-R_Phi/CEC.Arous13556000.txt")