The rigorous coupled-wave approach was implemented in a three-dimensional setting to calculate the chargecarrier-generation rate in a thin-film solar cell with multiple amorphous-silicon p-i-n junctions. The solar cell comprised a front antireflection window; three electrically isolated p-i-n junctions in tandem; and a periodically corrugated silver back-reflector with hillock-shaped corrugations arranged on a hexagonal lattice. The differential evolution algorithm (DEA) was used to maximize the charge-carrier-generation rate over a set of selected optical and electrical parameters. This optimization exercise minimized the bandgap of the topmost i-layer but all other parameters turned out to be uninfluential. More importantly, the exercise led to a configuration that would very likely render the solar cell inefficient. Therefore, another optimization exercise was conducted to maximize power density. The resulting configuration was optimal over all parameters.