-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Play/Discard now work using Hint instead of card index, Adding Privat…
…eInfo, reworking rollout to use both private/public info
- Loading branch information
1 parent
a70df5b
commit 503ed54
Showing
3 changed files
with
241 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
use crate::rand::Rng; | ||
|
||
pub trait Env { | ||
type PublicInfo; | ||
type Action; | ||
type Reward; | ||
|
||
pub trait HasEnd { | ||
fn is_over(&self) -> bool; | ||
} | ||
|
||
pub trait HasReward { | ||
type Reward; | ||
fn reward(&self) -> Self::Reward; | ||
fn public_info(&self, player_perspective: bool) -> Self::PublicInfo; | ||
fn determinize<R: Rng>(public_info: &Self::PublicInfo, rng: &mut R) -> Self; | ||
} | ||
|
||
pub trait Env: HasEnd + HasReward { | ||
type PublicInfo: HasEnd + HasReward + Clone; | ||
type PrivateInfo: Clone; | ||
type Action; | ||
|
||
fn determinize<R: Rng>( | ||
public_info: &Self::PublicInfo, | ||
private_info: &Self::PrivateInfo, | ||
rng: &mut R, | ||
) -> Self; | ||
|
||
fn public_info(&self) -> Self::PublicInfo; | ||
fn private_info(&self, player_perspective: bool) -> Self::PrivateInfo; | ||
|
||
fn actions(&self) -> Vec<Self::Action>; | ||
fn step<R: Rng>(&mut self, action: &Self::Action, rng: &mut R); | ||
} |
Oops, something went wrong.