122 - Trees on the level

本文介绍了一种使用C++实现的二叉树数据结构,并通过广度优先搜索(BFS)来检查树是否完整及输出节点值。文章详细展示了如何添加带有路径标识的节点、如何移除整个树结构以及如何读取输入并构建二叉树。
#include<iostream>
#include<cstdio>
#include<string.h>
#include<queue>
using namespace std;
const int maxn=10000+5;
struct Node{
  bool have_value;
  int v;
  Node *left,*right;
  Node():have_value(false),left(NULL),right(NULL){}
};

bool failed;
Node* tree;
char s[maxn];
Node* new_node()
{
  return new Node();
}

bool addnode(int v,char* s)
{
  int n=strlen(s);
  Node* node=tree;
  for(int i=0;i<n;i++){
    if('L'==s[i]){
      if(node->left==NULL)node->left=new_node();
      node=node->left;
    }
    if('R'==s[i]){
      if(node->right==NULL)node->right=new_node();
      node=node->right;
    }}
    if(node->have_value)return false;//重复输入
    node->v=v;
    node->have_value=true;
  return true;
}

void remove_tree(Node* tree)
{
  if(tree==NULL) return;
  remove_tree(tree->left);
  remove_tree(tree->right);
  delete tree;
}

void bfs()
{
  queue<Node*> nque;
  nque.push(tree);
  while(!nque.empty()){
    Node* node=nque.front();
    nque.pop();
    if(!node->have_value){printf("not complete\n");return;}
    printf("%d ",node->v);
    if(node->left!=NULL)nque.push(node->left);
    if(node->right!=NULL)nque.push(node->right);
  }
  printf("\n");
}

void read_input()
{
  tree=new_node();
  failed=false;
  while(scanf("%s",s)==1){
    if(!strcmp("()",s)){bfs();remove_tree(tree);tree=new_node();}
    else{
      int v;
      sscanf(&s[1],"%d",&v);
     if(!addnode(v,strchr(s,',')+1))failed=true;
    }
  }

}

int main()
{
  read_input();
  return 0;
}

翻译:and a material design model, for simulating the characteristics of the semiconductor equipment. Mitrovic and Strang [19] applied the first-principle simulation to virtual sensor measurements to facilitate the process performed by the semiconductor processing tool. However, semiconductor manufacturing consists of hundreds of processing phases, months of processing time and correlative process flows [20]. The corresponding behavior analysis of the tool failure degradation process is very limited. Thus, the results provide neither reliable and accurate physical or mathematical models nor confident experience feedback for mechanism-based modeling. This is the main limitation of the applications of model-based approaches. In the knowledge-based methods, competitive advantages for stabilizing maintenance processes and reducing unplanned costs are realized by holistic consideration of production processes [21]. Prescriptive maintenance is known as the highest maturity and complexity level of knowledge-based maintenance [22], and “how can we control the occurrence of a specific event” should be answered and useful advice for decision-making to be given to improve and optimize the upcoming maintenance processes [23]. Nemeth et al. [22] built on the concept of prescriptive maintenance and proposed a reference model called PriMa-X to support the implementation of a prescriptive maintenance strategy and the assessment of its maturity level, facilitating the integration of data driven methods for predicting future events and identify action fields to reach an enhanced target maturity state. Padovano et al. [24] proposed a framework to construct the missing link between prescriptive maintenance and production planning and control functions in a cyber–physical production environment. Shaheen and Németh [25], Silvestri et al. [26], and Zonta et al. [27] discussed the prescriptive maintenance methods for Industry 4.0 technologies. Obtaining domain knowledge and converting it to precise rules are usually difficult as they require strong background and experience. Besides, the new situations without being covered by the knowledge bases cannot be handled. Data-driven methods are effective when acquiring practical data is more convenient than establishing physical or analytical models [28]. With the development of sensor techniques and wide applications of advanced process control technologies [29], the numerous manufacturing data provide wide opportunities for applying the data-driven prognostics methods to deal with the failure time prediction in the semiconductor manufacturing. Based on the monitoring data, the system degradation tendency can be easily understood and predicted. Generally, data-driven methods applied to the prognostics in the industry are adapted from the ones used in machine learning [29], [30]: neural networks [10], [31], k-nearest neighbor [32], [33], statistical methods [11], [34], decision trees [35], [36], clustering analysis [37], [38], and so on. Regarding the prognostics in semiconductor manufacturing, Bouaziz et al. [40] addressed a predictive approach based on the Bayesian network to analyze the device health factor. It allows early scheduling for preventive maintenance and avoids unscheduled tool downtime. Jia et al. [41] developed an adaptive method on the basis of the polynomial neural network to infer the material removal rate in the chemical-mechanical planarization process of the semiconductor fabrication. Yang and Lee [42] applied the Bayesian belief network to analyze the causal relationship of the process variables and estimate their effects on wafer quality to achieve high-classification rates for wafer quality and identify the problematic sensors when any bad wafer is detected. In reality, the quantity and quality of the data collected from the processes are problematic when it comes to developing and maintaining effective data-driven prognostics models [43]. As the failure can be slowly accumulated, the relevant data for evaluating the failure behavior would be scarce. In addition, most data-driven prognostics methods in semiconductor manufacturing focus on the deterministic estimation without giving the confidence level of the inference of the tool failure prognostics, which implies how much effect on the accuracy of the prognostic models built upon the acquired data is unknown. Using the poorly monitoring data would result in an improper estimation of the cleaning time. For more accurate prognostics, it is necessary to have a good and reliable prognostic model. As the tool failure mechanisms and uncertainty in semiconductor manufacturing are complex and unavailable, this article proposes a data-driven prognostic method to study the failure behavior and predict the tendency on the basis of the obtained production data in the fabrication process. One of the achievements is implementing the prognostics for determining the explicit cleaning time and reducing the dependence on the mechanism analysis. A novel failure factor extraction and prognostic model is developed based on autoassociative regression (AR)-Gaussian process (GP), which is the integration of the AR [44] and the GP [45]. It can be used to analyze and extract the failure factors by the comparisons between the actual data and the fault-free data. Furthermore, with the analysis of the residual tendency, the abnormalities can be detected to be used as the variables of the prognostic model. To infer the future failure behaviors in the fabrication process of semiconductor manufacturing, the data-driven prognostic model is constructed on the basis of GP to present the degradation evolution in a probability distribution and evaluate the uncertainty. Thanks to the confident interval of each estimated value, the accuracy of the prediction influenced by the collected data quality can be presented. It cannot be done by the deterministic estimation. And the suitable cleaning time for the fabrication process is given based on the discussion of the possible failure phenomena in semiconductor manufacturing. This article is structured as follows. The prognostic problem in semiconductor manufacturing is defined and its issues are discussed in Section II. Section III details the novel AR-GP method. The feasibility and the promising results of the ARGP method are validated through a numerical example and a practical semiconductor manufacturing process for the failure factor extraction and failure behavior inference, respectively, in Section IV. Finally, Section V draws conclusions.
最新发布
11-24
半导体制造中的故障预测方法可分为三类,现就关键内容进行翻译和分析: 1. **模型驱动方法的局限**: - 现有模型(如Takako的3D设备仿真模型或Mitrovic的第一性原理模拟)难以覆盖数百道制程环节和长达数月的生产流程 - 设备退化行为的对应分析非常有限,既无法提供可靠的物理/数学模型,也缺乏有效的经验反馈机制 2. **知识驱动方法的进展**: - 预测性维护(Prescriptive Maintenance)作为最高成熟度层级,通过PriMa-X等参考模型实现决策优化 - 在工业4.0环境中构建与生产计划控制的数字孪生链接(如Padovano框架) - 核心挑战:领域知识获取与规则转化困难,难以处理知识库未覆盖的新场景 3. **数据驱动方法的实践**: ```python # 半导体制造中典型数据驱动预测示例(基于贝叶斯网络) import pymc3 as pm def build_bayesian_network(sensor_data): with pm.Model() as model: # 定义先验分布(设备健康因子) health_factor = pm.Normal('health', mu=0, sigma=1) # 定义观测节点(传感器读数似然函数) obs = pm.Poisson('obs', mu=pm.math.exp(health_factor), observed=sensor_data) # MCMC采样推断 trace = pm.sample(1000) return trace ``` - 应用场景: - Bouaziz的贝叶斯网络实现预防性维护调度 - Yang的贝叶斯信念网络分析晶圆质量因果关系 - 现存问题: - 数据质量影响模型有效性(故障数据稀疏) - 多数方法缺乏置信度评估(确定性估计局限) 4. **本文创新方法AR-GP**: - 通过自回归高斯过程(Auto-regressive Gaussian Process)整合: - 残差趋势分析检测异常变量 - 概率分布表征退化演化过程 - 核心优势: - 量化预测不确定性(置信区间) - 减少对机理分析的依赖
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值