Trust-aware hand-over#
Trust-aware hand-over: a robot policy built on the trust qubit.
The robot hands objects to a person. Whether the person takes the object smoothly depends on how much
they trust the robot at that moment, and trust changes with every success and failure
(OpenSystemBelief). The robot can also ask about trust, which tells it
where trust stands but, in the quantum-like model, also changes it (the question collapses the belief).
At each step the policy compares the expected cost of four actions:
|
normal speed; fails with probability \(1 - p_{\text{trust}}\) |
|
slower and more legible; costs |
|
costs |
|
costs |
The same policy can run on the classical MarkovBelief, where asking
only reads trust; comparing the two shows when the order-aware model changes the robot’s behaviour.
Examples
>>> from quantum_mind.families.dynamics import OpenSystemBelief
>>> from quantum_mind.applications.handover import TrustAwareHandover
>>> policy = TrustAwareHandover(OpenSystemBelief(phi0=0.6, a_pos=0.8, a_neg=1.2, gamma=0.3))
>>> policy.decide()['action'] # high trust: hand over normally
'handover'
>>> policy.observe(0); policy.observe(0) # two failures
>>> policy.decide()['action'] != 'handover'
True
Classes
Hand-over policy on a trust belief. |
Functions
Run a policy against a simulated person whose trust follows a model. |
- class TrustAwareHandover(model, fail_cost=10.0, slow_cost=1.0, ask_cost=0.5, wait_cost=0.3, slow_factor=0.5)[source]#
Bases:
objectHand-over policy on a trust belief.
- Parameters:
model (
OpenSystemBelieforMarkovBelief) – Trust model, with its parameters (fitted to the person or the population).fail_cost (
float, optional) – Cost of a failed hand-over (dropped object, startled person).slow_cost (
float, optional) – Extra cost of a slow hand-over.ask_cost (
float, optional) – Cost of asking “do you trust me to hand this over?”.wait_cost (
float, optional) – Cost of waiting one step.slow_factor (
float, optional) – Failure probability of a slow hand-over relative to a normal one.
- Variables:
rho (
numpy.ndarray) – Current trust belief as a 2 x 2 density matrix (open-system model), orNone.p (
float) – Current P(trust) (Markov model), orNone.
- observe(event)[source]#
Update the belief after a hand-over outcome.
- Parameters:
event (
int) – 1 for a success, 0 for a failure.
- simulate_handover_session(policy, person, events_rng, n_steps=20)[source]#
Run a policy against a simulated person whose trust follows a model.
The person’s real trust (a separate copy of the model) determines whether each hand-over succeeds and how the trust question is answered; the policy only sees outcomes and answers.
- Parameters:
policy (
TrustAwareHandover) – The robot’s policy (its own belief).person (
TrustAwareHandover) – The simulated person’s true trust state (only its belief is used).events_rng (
numpy.random.Generator)n_steps (
int, optional)
- Returns:
dict–cost(total),failures,asksandactions(list).