-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S3 object HospiNet #2
Comments
Just created a constructor for this S3 object but no generic method yet... |
Why do you have matrix and edgelist in your object? |
Well, sometimes we need the matrix (in spreading simulation) and sometimes we need the edgelist (for igraph), so since both are created at one point I thought we could keep them both and let the user choose what he/she wants... |
But you have methods to go from one to the other, no? You might not want to store the two types in one object as it might take a lot of memory? |
mydb = create_fake_patientDB(n_patients = 100000, n_hospital = 2500) we'll know what to remove if we have a memory size issue... ;-) |
Other question: should not we be able to apply the getMetrics, get_degree... functions on the HospiNet object and not on some igraph object only ? |
Sure but that would mean either
- having an igraph object within HospiNet (which raises the question you
asked before about size efficiency
- or doing the igraph converting at the getMetrics level (I think it's
what I introduced in one of my last commits)
- switch HospiNet from S3 to R6 and have an active field which would create
the igraph on the fly if and when it's needed (maybe the best solution...)
Le jeu. 1 août 2019 à 13:30, Nolwenn Le Meur <notifications@github.com> a
écrit :
… Other question: should not we be able to apply the getMetrics,
get_degree... functions on the HospiNet object and not on some igraph
object only ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2?email_source=notifications&email_token=ABVGM2KXVRO6EDLI6WLZYRDQCLJP3A5CNFSM4IFZUAK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3KNT5I#issuecomment-517265909>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABVGM2PVZFWCGUC4PK7JFJLQCLJP3ANCNFSM4IFZUAKQ>
.
|
I will need to do some reading up here on the difference between S3 and R6 objects, but the last option sounds like the best solution to me, indeed. As for @nolwenn 's question, it seems most intuitive to be able to apply these functions on the HospiNet object. |
I've implemented the R6 mechanism. You can see it at work at the end of the work-flow vignette (text of the vignette still needs to be updated...) |
Brilliant. Hadn't noticed yet... I'm still catching/reading up after being away for a week and a half. |
We need to build an S3 object, let's call it HospiNet, which will contain the hospital matrix and relevant indicators (see vignette for details). This object should have a dedicated summary and print method.
The text was updated successfully, but these errors were encountered: