[][src]Struct neumann::PolyMatrixGame

pub struct PolyMatrixGame { /* fields omitted */ }

Polynomial matrix games are Matrix Games whith perturbation terms in terms of polynomials.

Examples

Error term pushes the optimal strategy in a different direction than the error free optimal strategy.

let poly_matrix = vec![array![[0, 1], [1, 0]], array![[0, 2], [1, 0]]];
PolyMatrixGame::from(poly_matrix);

Error term diminishes the reward for the row player, but does not changes optimal strategies.

let poly_matrix = vec![array![[0, 1], [1, 0]], array![[0, -1], [-1, 0]]];
PolyMatrixGame::from(poly_matrix);

Implementations

impl PolyMatrixGame[src]

pub fn eval(&self, epsilon: f64) -> MatrixGame[src]

Returns the matrix game that corresponds to evaluate perturbation at epsilon.

pub fn epsilon_kernel_constant(&self) -> f64[src]

Returns a value for the error term epsilon such that kernels of optimal strategies are guaranteed not to change between this value and zero.

In particular, the value function is a rational function between zero and this value.

Examples

Error is noticed by the row player only if greater than one.

let poly_matrix = vec![array![[1, 1], [0, 0]], array![[0, 0], [1, 1]]];
let poly_matrix_game = PolyMatrixGame::from(poly_matrix);
assert!(poly_matrix_game.epsilon_kernel_constant() <= 1.);

pub fn is_value_positive(&self) -> bool[src]

Checks if the polynomail matrix game has at least the value of the error-free game at a right neigborhood of zero.

That is, there exists a positive threshold for which the value of the perturbed matrix game is at least as much as the value of the matrix game corresponding to evaluating the polynomial matrix game at zero.

pub fn degree(&self) -> usize[src]

pub fn is_uniform_value_positive(&self) -> bool[src]

Checks if the polynomail matrix game has a fixed strategy that ensures at least the value of the error-free game at a right neigborhood of zero.

That is, there exists a fixed strategy and a positive threshold for which the reward given by this strategy in the perturbed matrix game is at least as much as the value of the matrix game corresponding to evaluating the polynomial matrix game at zero.

pub fn functional_form_value(&self) -> Ratio<Polynomial<i32>>[src]

Returns the value function close to zero.

The value function close to zero is a rational function. At zero and far from zero, the value function might correspond to another rational function. In general, the value function of a polynomial matrix game is a piecewise rational function. See epsilon_kernel_constant to have a bound on the interval in which this rational function is indeed the value function.

Remarks

The Ratio returned is not simplified, i.e. there might be a polynomial factor in common between the numerator and denominator.

Examples

Two-actions linear matrix games can lead to quadratic numerator in the value function.

let poly_matrix = vec![array![[1, -1], [-1, 1]], array![[1, -3], [0, 2]]];
let poly_matrix_game = PolyMatrixGame::from(poly_matrix);
let value_function = poly_matrix_game.functional_form_value();
assert_eq!(value_function.numer().degree(), 2);
assert_eq!(value_function.numer(), &poly![0, 0, 2]);
assert_eq!(value_function.denom(), &poly![4, 6]);

pub fn shape(&self) -> [usize; 2][src]

Shape of the matrix game.

First the number of row actions, then the number of column actions.

Examples

Two-actions polynomial matrix games has shape [2, 2].

let poly_matrix = vec![array![[1, -1], [-1, 1]], array![[1, -3], [0, 2]], array![[2, 1], [4, 1]]];
let poly_matrix_game = PolyMatrixGame::from(poly_matrix);
assert_eq!(poly_matrix_game.shape(), [2, 2]);

pub fn actions_row(&self) -> usize[src]

Number of row actions

pub fn actions_column(&self) -> usize[src]

Number of column actions

Trait Implementations

impl Clone for PolyMatrixGame[src]

impl Debug for PolyMatrixGame[src]

impl Display for PolyMatrixGame[src]

impl<T> From<Vec<ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>>> for PolyMatrixGame where
    T: Into<i32> + Clone
[src]

fn from(poly_matrix: Vec<Array2<T>>) -> Self[src]

Panics

If an empty vector is given or the shape of the matrices do not coincide.

impl Into<ArrayBase<OwnedRepr<Polynomial<i32>>, Dim<[usize; 2]>>> for PolyMatrixGame[src]

fn into(self) -> Array2<Polynomial<i32>>[src]

Performs the conversion.

Examples

let poly_matrix = vec![array![[0, 1], [1, 0]], array![[0, 2], [3, 0]]];
let poly_matrix_game = PolyMatrixGame::from(poly_matrix);
let poly_array: Array2<Polynomial<i32>> = poly_matrix_game.into();
assert_eq!(poly_array[[0, 0]], poly![0]);
assert_eq!(poly_array[[0, 1]], poly![1, 2]);
assert_eq!(poly_array[[1, 0]], poly![1, 3]);
assert_eq!(poly_array[[1, 1]], poly![0]);

impl Into<Vec<ArrayBase<OwnedRepr<i32>, Dim<[usize; 2]>>>> for PolyMatrixGame[src]

impl PartialEq<PolyMatrixGame> for PolyMatrixGame[src]

impl StructuralPartialEq for PolyMatrixGame[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.