use traj_core::error::TrajResult;
use traj_core::frame::FrameChunk;
use traj_core::system::System;

use crate::executor::{Device, Plan, PlanOutput};

use super::ConductivityPlan;

impl Plan for ConductivityPlan {
    fn name(&self) -> &'static str {
        "conductivity"
    }

    fn set_frames_hint(&mut self, n_frames: Option<usize>) {
        self.frames_hint = n_frames;
    }

    fn init(&mut self, system: &System, device: &Device) -> TrajResult<()> {
        self.init_state(system, device)
    }

    fn process_chunk(
        &mut self,
        chunk: &FrameChunk,
        system: &System,
        device: &Device,
    ) -> TrajResult<()> {
        self.process_chunk_state(chunk, system, device)
    }

    fn finalize(&mut self) -> TrajResult<PlanOutput> {
        self.finalize_state()
    }
}
