Text this: Revolutionizing power resilience: innovative optimization for distributed generation integration