rename Stimulus
-> RegionGated
This commit is contained in:
@@ -224,23 +224,23 @@ impl AbstractStimulus for RngStimulus {
|
||||
|
||||
/// Apply a time-varying stimulus uniformly across some region
|
||||
#[derive(Clone)]
|
||||
pub struct Stimulus<R, T> {
|
||||
pub struct RegionGated<R, S> {
|
||||
region: R,
|
||||
stim: T,
|
||||
stim: S,
|
||||
}
|
||||
|
||||
impl<R, T> Stimulus<R, T> {
|
||||
pub fn new(region: R, stim: T) -> Self {
|
||||
impl<R, S> RegionGated<R, S> {
|
||||
pub fn new(region: R, stim: S) -> Self {
|
||||
Self {
|
||||
region, stim
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<R: Region + Sync, T: TimeVarying3 + Sync> AbstractStimulus for Stimulus<R, T> {
|
||||
impl<R: Region + Sync, S: AbstractStimulus + Sync> AbstractStimulus for RegionGated<R, S> {
|
||||
fn at(&self, t_sec: f32, pos: Meters) -> Fields {
|
||||
if self.region.contains(pos) {
|
||||
self.stim.at(t_sec)
|
||||
self.stim.at(t_sec, pos)
|
||||
} else {
|
||||
Fields::default()
|
||||
}
|
||||
|
Reference in New Issue
Block a user