### Programmatically create a partial justification object
exampleAssertion <-
preregr::assert(
"This is an assertion",
source = c(
preregr::source('This is a first source'),
preregr::source('This is a second source')));
### Programmatically create a justification with two assertions
### but without sources
exampleJustification <-
preregr::justify(
"Icecream will make me feel less fit",
assertion = c(
preregr::assert('Icecream is rich in energy'),
preregr::assert('Consuming high-energy foods makes me feel less fit')
),
weight = -.5
);
### Show it
exampleJustification;
### Programmatically create a simple decision
simpleDecision <-
preregr::decide(
"decision",
justification = preregr::jstf(
"justification",
assertion = exampleAssertion
)
);
### Programmatically create a justification object for a full decision
fullJustifierObject <-
preregr::decide(
"I decide to go get an icecream",
justification = c(
preregr::justify(
"Having an icecream now would make me happy",
assertion = c(
preregr::assert(
"Decreasing hunger increases happiness",
source = preregr::source(
"My past experiences"
)
),
preregr::assert(
"I feel hungry",
source = preregr::source(
"Bodily sensations"
)
)
),
weight = 1
),
exampleJustification,
preregr::justify(
"I can afford to buy an icecream.",
assertion = c(
preregr::assert(
"My bank account balance is over 300 euro.",
source = preregr::source(
"My bank app"
)
),
preregr::assert(
"I need to keep at least 100 euro in my bank account.",
source = preregr::source(
"Parental advice"
)
)
),
weight = .3
)
)
);
### Show the full object
fullJustifierObject;
### Combine both into a list of decisions
twoDecisions <-
c(simpleDecision,
fullJustifierObject);
### Show the combination
twoDecisions;
Run the code above in your browser using DataLab