temp save here

<?php session_start();$session=session_id();?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
</head>
<body>

<?php include("image/conn.php");
//计算batch号
$q5=$m->query("select max(batch) as batch from pick");
$r5=($q5->fetch_array(MYSQLI_USE_RESULT));
$batch=$r5['batch']+1;
//end 计算batch号

$q=$m->query("select I.name,I.number,I.style,I.color,I.size,sum(C.qty) as qty,C.input from cart C left join caseinfo I on C.number=I.number where C.status='0' and C.session='".$session."' group by I.style,I.size");//购物车需要的数量
while($r=$q->fetch_array(MYSQLI_USE_RESULT)){
	$qtyTemp=$r['qty'];
	$q2=$m->query("select I.number,I.pcs from inventory I left join caseinfo C on I.number=C.number where C.name=(select name from caseinfo where number='".$r[number]."') and C.style=(select style from caseinfo where number='".$r[number]."') and C.color=(select color from caseinfo where number='".$r[number]."') and C.size=(select size from caseInfo where number='".$r[number]."') and I.status='0' order by I.id");//库存里的数量
	while($r2=$q2->fetch_array(MYSQLI_USE_RESULT)){
		if($qtyTemp>=$r2['pcs']){
			$qtyTemp-=(int)$r2['pcs'];
			$m->query("insert into pick (batch,number,input) values ('".$batch."','".$r2['number']."','".$input."')");
			$m->query("update inventory set status='1' where number='".$r2['number']."'");
			$m->query("update caseinfo set status='2' where number='".$r2['number']."'");
			echo 'case pcs:'.$qtyTemp.'<br>';
			}
		else{
			$k=abs($qtyTemp);
			$qtyTemp-=(int)$r2['pcs'];
			$m->query("insert into pick (batch,number,pcs,input) values ('".$batch."','".$r2['number']."','".$k."','".$input."')");//放在拣货单

			$m->query("update inventory set status='1',batch='".$batch."',pick='".$k."' where number='".$r2['number']."'");//把原始的更新
			$m->query("update caseinfo set status='2' where number='".$r2['number']."'");
			//计算出剩下的数量与原库位
			$q7=$m->query("select weight,vol,pcs,location from inventory where number='".$r2['number']."' and id=(select min(id) from inventory where number='".$r2['number']."')");
			$r7=$q7->fetch_array(MYSQLI_USE_RESULT);
			$left=$r7[pcs]-$k;//把剩下的数量,变成新的箱子
			//end 数量与原为库位
			$m->query("insert into inventory (number,weight,vol,pcs,batch,location,op,input) values ('".$r2['number']."','".$r7[weight]."','".$r7[vol]."','".$left."','".$batch."','".$r7[location]."','".$_SESSION['auth']."','".$input."')");
			echo "insert into inventory (number,weight,vol,pcs,batch,location,op,input) values ('".$r2['number']."','".$r7[weight]."','".$r7[vol]."','".$left."','".$batch."','".$r7[location]."','".$_SESSION['auth']."','".$input."')<br>";
			echo 'rep-pick:'.$qtyTemp.'<br>';
			}
		if($qtyTemp<=0){
			$m->query("update cart set status='1' where session='".$session."'");
			break;}
		
		}
	}

© Silvaco Inc., 2018 go athena line x loc=0.0 spac=0.1 line x loc=0.2 spac=0.006 line x loc=0.4 spac=0.006 line x loc=0.6 spac=0.01 line y loc=0.0 spac=0.002 line y loc=0.2 spac=0.005 line y loc=0.5 spac=0.05 line y loc=0.8 spac=0.15 init orientation=100 c.phos=1e14 space.mul=2 #pwell formation including masking off of the nwell diffus time=30 temp=1000 dryo2 press=1.00 hcl=3 etch oxide thick=0.02 #P-well Implant implant boron dose=1e13 energy=100 pears diffus temp=1000 time=200 weto2 hcl=3 #N-well implant not shown - welldrive starts here diffus time=50 temp=1000 t.rate=4.000 dryo2 press=0.10 hcl=3 diffus time=220 temp=1200 nitro press=1 diffus time=90 temp=1200 t.rate=-4.444 nitro press=1 etch oxide all #sacrificial “cleaning” oxide diffus time=20 temp=1000 dryo2 press=1 hcl=3 etch oxide all #gate oxide grown here:- diffus time=11 temp=925 dryo2 press=1.00 hcl=3 Extract a design parameter extract name=“gateox” thickness oxide mat.occno=1 x.val=0.06 #vt adjust implant implant boron dose=9.5e11 energy=10 pearson depo poly thick=0.2 divi=10 #from now on the situation is 2-D etch poly left p1.x=0.35 method fermi compress diffuse time=3 temp=900 weto2 press=1.0 implant phosphor dose=3.0e13 energy=20 pearson depo oxide thick=0.120 divisions=8 etch oxide dry thick=0.120 implant arsenic dose=5.0e15 energy=50 pearson method fermi compress diffuse time=1 temp=900 nitro press=1.0 pattern s/d contact metal etch oxide left p1.x=0.2 deposit alumin thick=0.03 divi=2 etch alumin right p1.x=0.18 Extract design parameters extract final S/D Xj extract name=“nxj” xj silicon mat.occno=1 x.val=0.1 junc.occno=1 extract the N++ regions sheet resistance extract name=“n++ sheet rho” sheet.res material=“Silicon” mat.occno=1 x.val=0.05 region.occno=1 extract the sheet rho under the spacer, of the LDD region extract name=“ldd sheet rho” sheet.res material=“Silicon” mat.occno=1 x.val=0.3 region.occno=1 extract the surface conc under the channel. extract name=“chan surf conc” surf.conc impurity=“Net Doping” material=“Silicon” mat.occno=1 x.val=0.45 extract a curve of conductance versus bias. extract start material=“Polysilicon” mat.occno=1 bias=0.0 bias.step=0.2 bias.stop=2 x.val=0.45 extract done name=“sheet cond v bias” curve(bias,1dn.conduct material=“Silicon” mat.occno=1 region.occno=1) outfile=“extract.dat” extract the long chan Vt extract name=“n1dvt” 1dvt ntype vb=0.0 qss=1e10 x.val=0.18 structure mirror right electrode name=gate x=0.5 y=0.1 electrode name=source x=0.1 electrode name=drain x=1.1 electrode name=substrate backside structure outfile=mos1ex01_0.str plot the structure tonyplot mos1ex01_0.str -set mos1ex01_0.set ############# Vt Test : Returns Vt, Beta and Theta ################ go atlas set material models models cvt srh print contact name=gate n.poly interface qf=3e10 method newton solve init Bias the drain solve vdrain=0.1 Ramp the gate log outf=mos1ex01_1.log master solve vgate=0 vstep=0.25 vfinal=3.0 name=gate save outf=mos1ex01_1.str plot results tonyplot mos1ex01_1.log -set mos1ex01_1_log.set solve init solve vgate=0 save outf=solve_tmp1.str master solve vgate=0.25 save outf=solve_tmp2.str master solve vgate=0.5 save outf=solve_tmp3.str master solve vgate=1 save outf=solve_tmp4.str master solve vgate=2 save outf=solve_tmp5.str master solve vgate=3 save outf=solve_tmp6.str master load infile=solve_tmp1.str master log outf=mos_ids_1.log solve vdrain=0 vstep=0.25 vfinal=10 name=drain load infile=solve_tmp2.str master log outf=mos_ids_2.log solve vdrain=0 vstep=0.25 vfinal=10 name=drain load infile=solve_tmp3.str master log outf=mos_ids_3.log solve vdrain=0 vstep=0.25 vfinal=10 name=drain load infile=solve_tmp4.str master log outf=mos_ids_4.log solve vdrain=0 vstep=0.25 vfinal=10 name=drain load infile=solve_tmp5.str master log outf=mos_ids_5.log solve vdrain=0 vstep=0.25 vfinal=10 name=drain load infile=solve_tmp6.str master log outf=mos_ids_6.log solve vdrain=0 vstep=0.25 vfinal=10 name=drain tonyplot -overlay mos_ids_1.log mos_ids_2.log mos_ids_3.log mos_ids_4.log mos_ids_5.log mos_ids_6.log extract device parameters extract name=“nvt” (xintercept(maxslope(curve(abs(v.“gate”),abs(i.“drain”)))) - abs(ave(v.“drain”))/2.0) extract name=“nbeta” slope(maxslope(curve(abs(v.“gate”),abs(i.“drain”)))) * (1.0/abs(ave(v.“drain”))) extract name=“ntheta” ((max(abs(v.“drain”)) * " n b e t a " ) / m a x ( a b s ( i . " d r a i n " ) ) ) − ( 1.0 / ( m a x ( a b s ( v . " g a t e " ) ) − ( "nbeta")/max(abs(i."drain"))) −(1.0/(max(abs(v."gate"))−(“nvt”))) Quit 按照下面要求修改上面代码 运用atlas工具设计一个NMOS管, 在电流密度集中处网格加密;定义NMOSFET的模型,电极,计算方法; 转移特性:Vdrain:1V,3V; 输入输出特性:Vgate:0,0.25, 0.5, 1, 2, 3V, 电压0-10V. 通过tonyplot查看PN结的杂质浓度,电场分布,电子电流密度,空穴电流密度分布。 自己设计结构和模型 要求:沟道长度:0.18μm,Vth在0.5-0.7V之间 按照要求写出silvacoTCAD代码
06-22
# (c) Silvaco Inc., 2018 go athena # line x loc=0.0 spac=0.1 line x loc=0.2 spac=0.006 line x loc=0.4 spac=0.006 line x loc=0.6 spac=0.01 # line y loc=0.0 spac=0.002 line y loc=0.2 spac=0.005 line y loc=0.5 spac=0.05 line y loc=0.8 spac=0.15 # init orientation=100 c.phos=1e14 space.mul=2 #pwell formation including masking off of the nwell # diffus time=30 temp=1000 dryo2 press=1.00 hcl=3 # etch oxide thick=0.02 # #P-well Implant # implant boron dose=1e13 energy=100 pears # diffus temp=1000 time=200 weto2 hcl=3 # #N-well implant not shown - # # welldrive starts here diffus time=50 temp=1000 t.rate=4.000 dryo2 press=0.10 hcl=3 # diffus time=220 temp=1200 nitro press=1 # diffus time=90 temp=1200 t.rate=-4.444 nitro press=1 # etch oxide all # #sacrificial "cleaning" oxide diffus time=20 temp=1000 dryo2 press=1 hcl=3 # etch oxide all # #gate oxide grown here:- diffus time=11 temp=925 dryo2 press=1.00 hcl=3 # # Extract a design parameter extract name="gateox" thickness oxide mat.occno=1 x.val=0.06 # #vt adjust implant implant boron dose=9.5e11 energy=10 pearson # depo poly thick=0.2 divi=10 # #from now on the situation is 2-D # etch poly left p1.x=0.35 # method fermi compress diffuse time=3 temp=900 weto2 press=1.0 # implant phosphor dose=3.0e13 energy=20 pearson # depo oxide thick=0.120 divisions=8 # etch oxide dry thick=0.120 # implant arsenic dose=5.0e15 energy=50 pearson # method fermi compress diffuse time=1 temp=900 nitro press=1.0 # # pattern s/d contact metal etch oxide left p1.x=0.2 deposit alumin thick=0.03 divi=2 etch alumin right p1.x=0.18 # Extract design parameters # extract final S/D Xj extract name="nxj" xj silicon mat.occno=1 x.val=0.1 junc.occno=1 # extract the N++ regions sheet resistance extract name="n++ sheet rho" sheet.res material="Silicon" mat.occno=1 x.val=0.05 region.occno=1 # extract the sheet rho under the spacer, of the LDD region extract name="ldd sheet rho" sheet.res material="Silicon" \ mat.occno=1 x.val=0.3 region.occno=1 # extract the surface conc under the channel. extract name="chan surf conc" surf.conc impurity="Net Doping" \ material="Silicon" mat.occno=1 x.val=0.45 # extract a curve of conductance versus bias. extract start material="Polysilicon" mat.occno=1 \ bias=0.0 bias.step=0.2 bias.stop=2 x.val=0.45 extract done name="sheet cond v bias" \ curve(bias,1dn.conduct material="Silicon" mat.occno=1 region.occno=1)\ outfile="extract.dat" # extract the long chan Vt extract name="n1dvt" 1dvt ntype vb=0.0 qss=1e10 x.val=0.18 structure mirror right electrode name=gate x=0.5 y=0.1 electrode name=source x=0.1 electrode name=drain x=1.1 electrode name=substrate backside structure outfile=mos1ex01_0.str # plot the structure tonyplot mos1ex01_0.str -set mos1ex01_0.set ############# Vt Test : Returns Vt, Beta and Theta ################ go atlas # set material models models cvt srh print contact name=gate n.poly interface qf=3e10 method newton solve init # Bias the drain solve vdrain=0.1 # Ramp the gate log outf=mos1ex01_1.log master solve vgate=0 vstep=0.25 vfinal=3.0 name=gate save outf=mos1ex01_1.str # plot results tonyplot mos1ex01_1.log -set mos1ex01_1_log.set solve init solve vgate=0 save outf=solve_tmp1.str master solve vgate=0.25 save outf=solve_tmp2.str master solve vgate=0.5 save outf=solve_tmp3.str master solve vgate=1 save outf=solve_tmp4.str master solve vgate=2 save outf=solve_tmp5.str master solve vgate=3 save outf=solve_tmp6.str master load infile=solve_tmp1.str master log outf=mos_ids_1.log solve vdrain=0 vstep=0.25 vfinal=10 name=drain load infile=solve_tmp2.str master log outf=mos_ids_2.log solve vdrain=0 vstep=0.25 vfinal=10 name=drain load infile=solve_tmp3.str master log outf=mos_ids_3.log solve vdrain=0 vstep=0.25 vfinal=10 name=drain load infile=solve_tmp4.str master log outf=mos_ids_4.log solve vdrain=0 vstep=0.25 vfinal=10 name=drain load infile=solve_tmp5.str master log outf=mos_ids_5.log solve vdrain=0 vstep=0.25 vfinal=10 name=drain load infile=solve_tmp6.str master log outf=mos_ids_6.log solve vdrain=0 vstep=0.25 vfinal=10 name=drain tonyplot -overlay mos_ids_1.log mos_ids_2.log mos_ids_3.log mos_ids_4.log mos_ids_5.log mos_ids_6.log # extract device parameters extract name="nvt" (xintercept(maxslope(curve(abs(v."gate"),abs(i."drain")))) \ - abs(ave(v."drain"))/2.0) extract name="nbeta" slope(maxslope(curve(abs(v."gate"),abs(i."drain")))) \ * (1.0/abs(ave(v."drain"))) extract name="ntheta" ((max(abs(v."drain")) * $"nbeta")/max(abs(i."drain"))) \ - (1.0 / (max(abs(v."gate")) - ($"nvt"))) Quit 按照下面要求修改上面代码 运用atlas工具设计一个NMOS管, 在电流密度集中处网格加密;定义NMOSFET的模型,电极,计算方法; 转移特性:Vdrain:1V,3V; 输入输出特性:Vgate:0,0.25, 0.5, 1, 2, 3V, 电压0-10V. 通过tonyplot查看PN结的杂质浓度,电场分布,电子电流密度,空穴电流密度分布。 自己设计结构和模型 要求:沟道长度:0.18μm,Vth在0.5-0.7V之间 按照要求写出silvacoTCAD代码
06-22
import gymnasium as gym import numpy as np import time env = gym.make("MountainCar-v0") # Q-Learning settings LEARNING_RATE = 0.1 DISCOUNT = 0.95 EPISODES = 25000 SHOW_EVERY = 1000 # Exploration settings epsilon = 1 # not a constant, going to be decayed START_EPSILON_DECAYING = 1 END_EPSILON_DECAYING = EPISODES//2 epsilon_decay_value = epsilon/(END_EPSILON_DECAYING - START_EPSILON_DECAYING) DISCRETE_OS_SIZE = [20, 20] discrete_os_win_size = (env.observation_space.high - env.observation_space.low)/DISCRETE_OS_SIZE def get_discrete_state(state): discrete_state = (state - env.observation_space.low)/discrete_os_win_size return tuple(discrete_state.astype(np.int64)) # we use this tuple to look up the 3 Q values for the available actions in the q-table q_table = np.random.uniform(low=-2, high=0, size=(DISCRETE_OS_SIZE + [env.action_space.n])) # 记录成功次数 success_count = 0 for episode in range(EPISODES): state, _ = env.reset() # Gymnasium返回(state, info) discrete_state = get_discrete_state(state) if episode % SHOW_EVERY == 0: render = True print(f"Episode: {episode}, Success count: {success_count}") else: render = False done = False truncated = False episode_success = False while not done and not truncated: if np.random.random() > epsilon: # Get action from Q table action = np.argmax(q_table[discrete_state]) else: # Get random action action = np.random.randint(0, env.action_space.n) new_state, reward, done, truncated, _ = env.step(action) # Gymnasium返回5个值 new_discrete_state = get_discrete_state(new_state) # If simulation did not end yet after last step - update Q table if not done and not truncated: # Maximum possible Q value in next step (for new state) max_future_q = np.max(q_table[new_discrete_state]) # Current Q value (for current state and performed action) current_q = q_table[discrete_state + (action,)] # And here's our equation for a new Q value for current state and action new_q = (1 - LEARNING_RATE) * current_q + LEARNING_RATE * (reward + DISCOUNT * max_future_q) # Update Q table with new Q value q_table[discrete_state + (action,)] = new_q # Simulation ended - if goal position is achieved elif new_state[0] >= 0.5: # MountainCar的目标位置是0.5 q_table[discrete_state + (action,)] = 0 episode_success = True success_count += 1 print(f"We made it on episode {episode}! Total successes: {success_count}") # 强制渲染成功的过程 if not render: # 重新渲染最后几步来展示成功过程 print("Showing the successful climb...") # 重新模拟最后几步并渲染 temp_state = new_state temp_discrete_state = new_discrete_state for i in range(10): # 展示最后10步 action = np.argmax(q_table[temp_discrete_state]) temp_state, _, temp_done, temp_truncated, _ = env.step(action) temp_discrete_state = get_discrete_state(temp_state) env.render() time.sleep(0.1) if temp_done or temp_truncated: break # 在成功时暂停一下,让你能看到结果 time.sleep(1) discrete_state = new_discrete_state if render: env.render() time.sleep(0.01) # 添加小延迟让渲染更清晰 # Decaying is being done every episode if episode number is within decaying range if END_EPSILON_DECAYING >= episode >= START_EPSILON_DECAYING: epsilon -= epsilon_decay_value # 训练结束后,展示最终的学习效果 print("\nTraining completed! Showing final performance...") for i in range(5): # 展示5次成功运行 state, _ = env.reset() discrete_state = get_discrete_state(state) done = False truncated = False steps = 0 while not done and not truncated and steps < 1000: # 限制最大步数 action = np.argmax(q_table[discrete_state]) state, reward, done, truncated, _ = env.step(action) discrete_state = get_discrete_state(state) env.render() time.sleep(0.02) steps += 1 if state[0] >= 0.5: # MountainCar的目标位置是0.5 print(f"Demo {i+1}: Success in {steps} steps!") time.sleep(1) break env.close() # 保存Q-table # np.save("mountaincar_q_table.npy", q_table)逐行解读代码并写出运用的公式知识点
10-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值