Skip to content

Refactor rdiffnet #45

@gvegayon

Description

@gvegayon

Example of flowchart using mermaid (You don't need to use this, draw.io also has this)

flowchart LR
  is_seedpnodes_list{Is seed p nodes list} -->|Yes| B
  is_seedpnodes_list -->|No| C
Loading

The ideal function should have:

  • Allow passing a list for some of the arguments, in which case it assumes a multi-behavior model.
  • Arguments are are not passed as list, should be recycled, e.g., if seed.p.nodes is a list but seed.nodes as a vector (indicating seed vertices), then the program should do something like seed.nodes <- list(seed.nodes, seed.nodes)

Need to think about the sim process.

For the preprocessing, you could have something like this:

rdiffnet_validate_args <- function(seed.p.nodes, seed.nodes, behavior) {
   ... do all the checks to validate length and stuff ...
   list(
     seed.p.nodes = ...,
     seed.nodes = ...,
     behavior = ...,
     num_of_behaviors = ...
   )
}

rdiffnet <- function( ... ) {
  
    validated_args <- rdiffnet_validate_args(seed.p.nodes, seed.nodes, behavior)

    ....

    # if you want to use seed.p.nodes
    validated_args$seed.p.nodes
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions