Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
2ecc8d4
Add the example directory
pradeeban May 25, 2022
eaf5754
Merge branch 'main' of github.com:ControlCore-Project/concore into main
pradeeban May 25, 2022
687a43e
Update README.md
pradeeban Aug 8, 2022
99de41a
Update README.md
pradeeban Aug 8, 2022
eb9e556
Update README.md
pradeeban Aug 8, 2022
8064bc9
Update README.md
pradeeban Aug 8, 2022
857c9f4
Update README.md
pradeeban Aug 8, 2022
4964198
Update README.md
pradeeban Aug 8, 2022
cc0b93b
Update README.md
pradeeban Aug 9, 2022
f2804df
Update README.md
pradeeban Aug 9, 2022
8c80c57
Update README.md
pradeeban Aug 9, 2022
806a304
Update README.md
pradeeban Aug 9, 2022
c5ee709
Update README.md
pradeeban Aug 9, 2022
ad656e5
Update README.md
pradeeban Aug 9, 2022
d7066c2
Update README.md
pradeeban Aug 9, 2022
ca58976
Update README.md
pradeeban Aug 9, 2022
0abd809
Update README.md
pradeeban Aug 9, 2022
f29fb09
Update README.md
pradeeban Aug 9, 2022
039a57a
Create draft-pdf.yml
pradeeban Aug 9, 2022
7056c16
Create paper.md
pradeeban Aug 9, 2022
6dc9ef2
Update paper.md
pradeeban Aug 9, 2022
31e4d57
Update paper.md
pradeeban Aug 9, 2022
eedae7e
Create paper.bib
pradeeban Aug 9, 2022
a0261f8
Update paper.md
pradeeban Aug 9, 2022
e7763d1
Update paper.md
pradeeban Aug 9, 2022
49557e2
Update paper.md
pradeeban Aug 9, 2022
164edd8
Update paper.md
pradeeban Aug 9, 2022
2de923f
Update paper.md
pradeeban Aug 9, 2022
ab6dac4
Update paper.md
pradeeban Aug 9, 2022
56f25bf
Update paper.md
pradeeban Aug 9, 2022
544e26c
Update paper.md
pradeeban Aug 9, 2022
23108f1
Update paper.md
pradeeban Aug 9, 2022
00b582e
Update paper.md
pradeeban Aug 9, 2022
eb7edb9
Update paper.md
pradeeban Aug 9, 2022
47a902c
Update paper.md
pradeeban Aug 9, 2022
d3a43ed
Update paper.md
pradeeban Aug 9, 2022
eadc13d
Update README.md
pradeeban Aug 9, 2022
fc54f5c
Update CONTRIBUTING.md
pradeeban Aug 9, 2022
dbe4ec2
Update paper.md
pradeeban Aug 9, 2022
5307470
Add arch diagram
pradeeban Aug 10, 2022
3ef7685
Update paper.md
pradeeban Aug 10, 2022
192aba7
Update paper.md
pradeeban Aug 10, 2022
87debbd
Update paper.md
pradeeban Aug 10, 2022
142e67f
Update paper.md
pradeeban Aug 10, 2022
782594d
Update paper.bib
pradeeban Aug 10, 2022
148de00
Update paper.md
pradeeban Aug 10, 2022
4954eb9
Add DOIs to the paper
pradeeban Aug 11, 2022
297222a
Update README.md
pradeeban Aug 11, 2022
a050eeb
learn.py and graphml
markgarnold Aug 16, 2022
c091bd1
Create README for ratc
pradeeban Aug 16, 2022
731fd03
ratc study:program mapping
pradeeban Aug 16, 2022
6fd997e
Update README.md
pradeeban Aug 16, 2022
411d387
Update README.md
pradeeban Aug 16, 2022
29f2609
Update README.md
pradeeban Aug 16, 2022
3819e76
Update README.md
pradeeban Aug 16, 2022
519eab5
Update README.md
pradeeban Aug 16, 2022
bab58c1
Update learn.py
markgarnold Aug 17, 2022
df47ed6
Merge branch 'main' of https://github.com/ControlCore-Project/concore…
markgarnold Aug 17, 2022
318bdbb
Update learn.py
markgarnold Aug 17, 2022
492af78
Update README.md
pradeeban Aug 17, 2022
25fe2b2
Update README.md
pradeeban Aug 17, 2022
e17dbe6
Update README.md
pradeeban Aug 17, 2022
8050ece
Update README.md
pradeeban Aug 17, 2022
6d3c10e
learn.py 10x faster than pm/ctl
markgarnold Aug 21, 2022
d4c11e2
Merge branch 'main' of https://github.com/ControlCore-Project/concore…
markgarnold Aug 21, 2022
592dfed
Update README.md
pradeeban Aug 31, 2022
fa69871
Update README.md
pradeeban Aug 31, 2022
b992d9d
Create README.md
pradeeban Aug 31, 2022
3e9ac7e
Add the initial tools
pradeeban Aug 31, 2022
d3891e2
Placeholder directory for human cardiac models.
pradeeban Aug 31, 2022
11f2407
Creating humanc files
Olusanmi-A Sep 2, 2022
8984b66
Merge pull request #19 from Olusanmi-A/main
pradeeban Sep 2, 2022
21b3c62
hcm_bang to play with
markgarnold Sep 7, 2022
7c9d8b3
pretending bangbang is pid
shanferns12 Sep 7, 2022
862048c
Merge pull request #20 from shanferns12/main
pradeeban Sep 7, 2022
c2c4d91
Update shannon.py
shanferns12 Sep 14, 2022
d249c83
Merge branch 'ControlCore-Project:main' into main
shanferns12 Sep 14, 2022
5ecfceb
Merge pull request #21 from shanferns12/main
pradeeban Sep 14, 2022
b450cb0
HR<->MAP in tools match ratc (change still needed in humanc)
markgarnold Sep 16, 2022
bd545f6
HR MAP switched
Olusanmi-A Sep 16, 2022
6b93eb0
Merge pull request #22 from Olusanmi-A/main
pradeeban Sep 16, 2022
79e0257
Update editgraph
pradeeban Sep 16, 2022
b590728
Update editgraph
pradeeban Sep 16, 2022
4240177
Update editgraph.bat
pradeeban Sep 16, 2022
ceb133e
concore.params and pidsig.py that uses it
markgarnold Sep 18, 2022
f5090d8
pidsig allows control input,cin ('map' or 'hr'), as param
markgarnold Sep 19, 2022
2d69716
check for bad params
markgarnold Sep 20, 2022
1504156
fixed concore.params for windows
markgarnold Sep 20, 2022
277742b
Update CONTRIBUTING.md
pradeeban Sep 20, 2022
1d0298e
concore.params fixed win fix
markgarnold Sep 21, 2022
347e23e
windows fix for concore.params
markgarnold Sep 21, 2022
26304e5
convert param=val to dict
markgarnold Sep 21, 2022
bc35181
param=val in concoredocker
markgarnold Sep 21, 2022
cf50b00
deblank param=val
markgarnold Sep 21, 2022
10f8bd8
Fix docker version for concore.params
pradeeban Sep 21, 2022
971d62a
testC3max
markgarnold Sep 22, 2022
c645444
powermeter.cpp 2 instances of concore
markgarnold Sep 22, 2022
e23e98d
powermetermax using concore2
markgarnold Sep 23, 2022
2fc3d78
learn2, concore2: learn3, mix
markgarnold Sep 24, 2022
a74cbd6
; instead of , for concore.params
markgarnold Sep 24, 2022
5b1aab4
tools/pidscript, tools/runhelp
markgarnold Sep 26, 2022
b77b088
set point for yuyu (cvxpysp); learn2 historyfull
markgarnold Sep 26, 2022
122a371
learn3 historyfull
markgarnold Sep 26, 2022
f9336ac
learn3 terminates n-1
markgarnold Sep 27, 2022
8882bc9
learn2 and learn3 show two prev HR,MAP states
markgarnold Sep 27, 2022
200ca39
pretty examples
markgarnold Sep 30, 2022
08ce4fe
mayuresh, funbody, funcall
markgarnold Oct 2, 2022
7df21db
pidmayuresh returns state
markgarnold Oct 3, 2022
abdc0ea
Update pidmayuresh.py
markgarnold Oct 3, 2022
e7e9f20
remove globals from mayuresh
markgarnold Oct 3, 2022
718cb16
Create pidmayuresh3.py
markgarnold Oct 3, 2022
0e56cf6
Create oldeditgraph
markgarnold Oct 5, 2022
a44a65f
mayuresh -> may
markgarnold Oct 5, 2022
2c31338
Chrome; funcall/body; test6
markgarnold Oct 19, 2022
f03fa54
funbody/call uses concore2.simtime
markgarnold Oct 19, 2022
0fa80f2
0mq funcall/funbody test0mq
markgarnold Oct 23, 2022
06a86dd
Update funbody.py
markgarnold Oct 23, 2022
c5f0ef7
funcall2
markgarnold Oct 26, 2022
48c8505
Update README.md
pradeeban Nov 22, 2022
1da6db4
Add files via upload
pradeeban Dec 21, 2022
5d5ae09
Fix README to use main branch
pradeeban Jan 8, 2023
01a426e
Merge branch 'dev' into main
pradeeban Jan 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/draft-pdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on: [push]

jobs:
paper:
runs-on: ubuntu-latest
name: Paper Draft
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build draft PDF
uses: openjournals/openjournals-draft-action@master
with:
journal: joss
# This should be the path to the paper within your repo.
paper-path: paper.md
- name: Upload
uses: actions/upload-artifact@v1
with:
name: paper
# This is the output path where Pandoc will write the compiled
# PDF. Note, this should be the same directory as the input
# paper.md
path: paper.pdf
29 changes: 29 additions & 0 deletions 0mq/cpymax.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import concore
import time
concore.delay = 0.01
#Nsim = 100
init_simtime_u = "[0.0, 0.0, 0.0]"
init_simtime_ym = "[0.0, 0.0, 0.0]"
minElasped = 10000000
maxElasped = 0
sumElasped = 0
u = concore.initval(init_simtime_u)
wallclock1 = time.perf_counter()
while(concore.simtime<concore.maxtime):
while concore.unchanged():
ym = concore.read(1,"ym",init_simtime_ym)
u[0] = ym[0]+1
print("ym="+str(ym[0])+" u="+str(u[0]));
concore.write(1,"u",u);
wallclock2 = time.perf_counter()
elasped = wallclock2-wallclock1
sumElasped += elasped
wallclock1 = wallclock2
minElasped = min(minElasped, elasped)
maxElasped = max(maxElasped, elasped)

#concore.write(1,"u",init_simtime_u)
print("retry="+str(concore.retrycount))
print("min="+str(minElasped))
print("avg="+str(sumElasped/concore.maxtime))
print("max="+str(maxElasped))
113 changes: 113 additions & 0 deletions 0mq/funbody.dir/concore2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
import time
import os
from ast import literal_eval
import sys
import re

#if windows, create script to kill this process
# because batch files don't provide easy way to know pid of last command
# ignored for posix!=windows, because "concorepid" is handled by script
# ignored for docker (linux!=windows), because handled by docker stop
if hasattr(sys, 'getwindowsversion'):
with open("concorekill.bat","w") as fpid:
fpid.write("taskkill /F /PID "+str(os.getpid())+"\n")

try:
iport = literal_eval(open("concore.iport").read())
except:
iport = dict()
try:
oport = literal_eval(open("concore.oport").read())
except:
oport = dict()


s = ''
olds = ''
delay = 1
retrycount = 0
inpath = "./in" #must be rel path for local
outpath = "./out"

#9/21/22
try:
sparams = open(inpath+"1/concore.params").read()
if sparams[0] == '"': #windows keeps "" need to remove
sparams = sparams[1:]
sparams = sparams[0:sparams.find('"')]
if sparams != '{':
print("converting sparams: "+sparams)
sparams = "{'"+re.sub(';',",'",re.sub('=',"':",re.sub(' ','',sparams)))+"}"
print("converted sparams: " + sparams)
try:
params = literal_eval(sparams)
except:
print("bad params: "+sparams)
except:
params = dict()
#9/30/22
def tryparam(n,i):
try:
return params[n]
except:
return i


#9/12/21
def default_maxtime(default):
global maxtime
try:
maxtime = literal_eval(open(inpath+"1/concore.maxtime").read())
except:
maxtime = default
default_maxtime(100)

def unchanged():
global olds,s
if olds==s:
s = ''
return True
else:
olds = s
return False

def read(port, name, initstr):
global s,simtime,retrycount
time.sleep(delay)
try:
infile = open(inpath+str(port)+"/"+name);
ins = infile.read()
except:
ins = initstr
while len(ins)==0:
time.sleep(delay)
ins = infile.read()
retrycount += 1
s += ins
inval = literal_eval(ins)
simtime = max(simtime,inval[0])
return inval[1:]

def write(port, name, val, delta=0):
global outpath,simtime
if isinstance(val,str):
time.sleep(2*delay)
elif isinstance(val,list)==False:
print("mywrite must have list or str")
quit()
try:
with open(outpath+str(port)+"/"+name,"w") as outfile:
if isinstance(val,list):
outfile.write(str([simtime+delta]+val))
simtime += delta
else:
outfile.write(val)
except:
print("skipping"+outpath+str(port)+"/"+name);

def initval(simtime_val):
global simtime
val = literal_eval(simtime_val)
simtime = val[0]
return val[1:]

69 changes: 69 additions & 0 deletions 0mq/funbody.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import concore
import concore2
import time
from osparc_control import CommandManifest
from osparc_control import CommandParameter
from osparc_control import CommandType
from osparc_control import PairedTransmitter
# declare some commands to which a reply can be provided
CONCORE_MANIFEST = CommandManifest(
action="fun",
description="function call",
params=[
CommandParameter(name="u", description="control move"),
],
command_type=CommandType.WITH_IMMEDIATE_REPLY,
)


print("funbody 0mq")
# initialization of 0mq/osparc-control "paired_transmitter"
paired_transmitter = PairedTransmitter(
remote_host="localhost",
exposed_commands=[CONCORE_MANIFEST],
remote_port=2346,
listen_port=2345,)

paired_transmitter.start_background_sync()

concore.delay = 0.07
concore2.delay = 0.07
concore2.inpath = concore.inpath
concore2.outpath = concore.outpath
concore2.simtime = 0
concore.default_maxtime(100)
init_simtime_u = "[0.0, 0.0, 0.0]"
init_simtime_ym = "[0.0, 0.0, 0.0]"

u = concore.initval(init_simtime_u)
ym = concore2.initval(init_simtime_ym)
while(concore2.simtime<concore.maxtime):
#while concore.unchanged():
# u = concore.read(concore.iport['U1'],"u",init_simtime_u)
command_list = paired_transmitter.get_incoming_requests()
while len(command_list)==0:
time.sleep(.01)
command_list = paired_transmitter.get_incoming_requests()
if len(command_list)>1:
print("too many commands at once!")
command = command_list[0]
if command.action == CONCORE_MANIFEST.action:
u = command.params["u"]
concore.simtime = u[0]
u = u[1:]
concore.write(concore.oport['U2'],"u",u)
print(u)
old2 = concore2.simtime
while concore2.unchanged() or concore2.simtime <= old2:
ym = concore2.read(concore.iport['Y2'],"ym",init_simtime_ym)
ym = [concore2.simtime]+ym
print(f"Replying to {command.action} with {ym}")
paired_transmitter.reply_to_command(
request_id=command.request_id, payload=ym)
else:
print("undefined action"+str(command.action))
quit()
#concore2.write(concore.oport['Y1'],"ym",ym)
print("funbody u="+str(u)+" ym="+str(ym)+" time="+str(concore2.simtime))
paired_transmitter.stop_background_sync()
print("retry="+str(concore.retrycount))
113 changes: 113 additions & 0 deletions 0mq/funbody2.dir/concore2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
import time
import os
from ast import literal_eval
import sys
import re

#if windows, create script to kill this process
# because batch files don't provide easy way to know pid of last command
# ignored for posix!=windows, because "concorepid" is handled by script
# ignored for docker (linux!=windows), because handled by docker stop
if hasattr(sys, 'getwindowsversion'):
with open("concorekill.bat","w") as fpid:
fpid.write("taskkill /F /PID "+str(os.getpid())+"\n")

try:
iport = literal_eval(open("concore.iport").read())
except:
iport = dict()
try:
oport = literal_eval(open("concore.oport").read())
except:
oport = dict()


s = ''
olds = ''
delay = 1
retrycount = 0
inpath = "./in" #must be rel path for local
outpath = "./out"

#9/21/22
try:
sparams = open(inpath+"1/concore.params").read()
if sparams[0] == '"': #windows keeps "" need to remove
sparams = sparams[1:]
sparams = sparams[0:sparams.find('"')]
if sparams != '{':
print("converting sparams: "+sparams)
sparams = "{'"+re.sub(';',",'",re.sub('=',"':",re.sub(' ','',sparams)))+"}"
print("converted sparams: " + sparams)
try:
params = literal_eval(sparams)
except:
print("bad params: "+sparams)
except:
params = dict()
#9/30/22
def tryparam(n,i):
try:
return params[n]
except:
return i


#9/12/21
def default_maxtime(default):
global maxtime
try:
maxtime = literal_eval(open(inpath+"1/concore.maxtime").read())
except:
maxtime = default
default_maxtime(100)

def unchanged():
global olds,s
if olds==s:
s = ''
return True
else:
olds = s
return False

def read(port, name, initstr):
global s,simtime,retrycount
time.sleep(delay)
try:
infile = open(inpath+str(port)+"/"+name);
ins = infile.read()
except:
ins = initstr
while len(ins)==0:
time.sleep(delay)
ins = infile.read()
retrycount += 1
s += ins
inval = literal_eval(ins)
simtime = max(simtime,inval[0])
return inval[1:]

def write(port, name, val, delta=0):
global outpath,simtime
if isinstance(val,str):
time.sleep(2*delay)
elif isinstance(val,list)==False:
print("mywrite must have list or str")
quit()
try:
with open(outpath+str(port)+"/"+name,"w") as outfile:
if isinstance(val,list):
outfile.write(str([simtime+delta]+val))
simtime += delta
else:
outfile.write(val)
except:
print("skipping"+outpath+str(port)+"/"+name);

def initval(simtime_val):
global simtime
val = literal_eval(simtime_val)
simtime = val[0]
return val[1:]

Loading