public static SpiceSource Allocate(double dc,double acmag,double acphase,
				       int trantype,double params[],
				       double vil,double vih) {
	SpiceSource s;

	if (trantype == NetlistConsumer.PWL)
	    s = new SpicePWLSource(dc,acmag,acphase,params,vil,vih);
	else if (trantype == NetlistConsumer.PULSE)
	    s = new SpicePulseSource(dc,acmag,acphase,params,vil,vih);
	else if (trantype == NetlistConsumer.SIN)
	    s = new SpiceSinSource(dc,acmag,acphase,params,vil,vih);
	else if (trantype == NetlistConsumer.EXP)
	    s = new SpiceExpSource(dc,acmag,acphase,params,vil,vih);
	else if (trantype == NetlistConsumer.SFFM)
	    s = new SpiceSFFMSource(dc,acmag,acphase,params,vil,vih);
	else if (trantype == NetlistConsumer.AM)
	    s = new SpiceAMSource(dc,acmag,acphase,params,vil,vih);
	else
	    s = new SpiceSource(dc,acmag,acphase);

	// if no DC value specified, use transient value at time 0
	if (s.dc == Double.NEGATIVE_INFINITY) s.dc = s.TransientValue(0);
	// if still no DC value, default to 0
	if (s.dc == Double.NEGATIVE_INFINITY) s.dc = 0;

	return s;
    }