设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11631|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# j& ?$ E: Q- j0 \! n$ I$ P2 g
% T4 `7 b: Q, c) J$ m我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。
' o0 Z" b, o& q5 R2 ~+ `& R/ ~1 j. z+ e) k, T3 g) C
begin P_read arriving* Q$ P1 p, L/ p. A% k9 y1 M# E2 v
    while 1=1 do begin
% _+ O' M" w# B* M3 ~1 e        read A_tote from "data.txt" with delimiter "\n"
9 ?! v- V1 [/ I. e* t        read A_time from "data.txt" with delimiter "\n"
! f( ~* x& O+ I1 O7 H        read A_leave from "data.txt" with delimiter "\n"% Y( z. d- ^6 n9 X* ]  }! m
        read A_picks from "data.txt" with delimiter "\n"$ W# O9 ?% H5 J7 e5 L- E' v
        set load type to A_tote
7 w- S* f, I( g. s7 Y+ Z$ h" y6 `        if A_tote="tote 1" then set A_induct to 1
  H4 N! V9 Q2 q& i        else if A_tote="tote 2" then set A_induct to 2+ X+ n; [/ [# `% p5 \' C. `7 |
            else set A_induct to 3    ; H  {; F3 ]3 l6 d% s" g- T
        set A_i to 0
# R. T8 a7 m5 G6 |, e* D+ {  M, y        clone 1 load to P_induction# T" U0 A  B" t1 o/ C
        wait for A_time sec3 U% E0 c$ c' f) {$ \" m
    end
" l% p# \' Z& B: pend1 v3 _/ Y: d3 c$ C
. K7 m. W' I9 K
begin P_induction arriving
) b* l; a7 I9 w: Q    if A_induct=1 then clone 1 load to P_pick1, x: Y" L8 `' ?$ s4 d7 G5 N
    else if A_induct=2 then clone 1 load to P_pick20 ^+ X  B% w5 p. K4 B
        else clone 1 load to P_pick3
4 T2 j( `8 \% e4 Q" `3 Q6 Oend' ?4 a# [2 E0 Z5 K! `; [
9 J0 w/ \9 Q: O3 ]: A- b! i% X/ o
begin P_pick1 arriving
7 D. `/ a) o3 X6 E) C    set A_i to 1' X  w" }- M0 O# P" X
    move into Q_induct1/ t% R  s+ k# Y" k* \
    move into pickaisle.induct1
: g- c' L4 c6 a$ |* z    while A_i<=30 do begin5 o4 M$ G' [% C) `: u
        travel to pickaisle.con(A_i): r; P9 a0 |  d/ c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# y8 I+ b& J% w- d        else wait for 10 sec
$ U8 V3 V& ]. g3 ]        if A_i=A_leave then send to die
/ h% y- }2 }; ~$ U        else inc A_i by 1
7 a' T$ U2 y9 R5 k    end; N: M7 w. p" F3 g
end
! _  C3 Z' f2 N& y
4 h7 m- L  B* ^! U8 `begin P_pick2 arriving4 I3 l5 M# V: _) }: H
    set A_i to 11
/ }! @4 o5 \+ w# P3 ^4 f* u$ C    move into Q_induct2
2 E$ T9 H7 Y) z) z    move into pickaisle.induct27 m* U( G7 @  b& [; C  E% T$ X
    while A_i<=30 do begin
7 a0 a/ W/ @; K. a0 |" i        travel to pickaisle.con(A_i)
5 H; }  N/ W% s( S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: o& I# R5 y. A# b9 u: x        else wait for 10 sec' o3 D+ R' L( e* p# T$ B8 }# U
        if A_i=A_leave then send to die% G0 B& `7 R' c
        else inc A_i by 16 V: I  R4 G; f& O8 D, F7 w' `
    end0 P3 h7 s  ~/ h7 g- l. ?5 I
end" w0 \. R. z2 s- Z  q! f
9 D& v/ F' M) ~+ M3 L2 \; H9 w
begin P_pick3 arriving
" a$ G5 c3 {0 f* f% n( o    set A_i to 21
3 F5 S4 }5 b' y" x" F    move into Q_induct37 J# l2 B: T2 H4 r/ _" \
    move into pickaisle.induct3
  }/ g. w, D3 e2 V- b' w. J    while A_i<=30 do begin
6 B' M5 U+ d$ i        travel to pickaisle.con(A_i); i2 V& v: Y& |; j9 x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. q) y* L! q3 z9 f% v. |7 O
        else wait for 10 sec
1 E5 u; D+ P. G* h        if A_i=A_leave then send to die
! A- @+ _7 Y9 I) p        else inc A_i by 18 a# t) `3 Z2 e" n) R5 z
    end
! j) F2 F. N4 D' Y/ Q" xend

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?+ ~- |% \& K8 o& r
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
2 M7 f- z( i3 m. N/ O8 L  _4 l* X* S- q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
" N" }) Q* H) r9 b) ]
% n2 p- O& o$ P+ |* L* Y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; I, L  G% B8 {! W2 [4 K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. b6 A5 _$ N+ M0 d' q! `& l2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 S0 O$ K5 E: f4 t9 v. o; Q
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, H6 T7 u- Z, S' U5 C! P# ?begin P_induction arriving
( A; ^: G6 f2 g3 x2 _  x1 y    clone 1 load to P_pick(A_induct)
* d7 j6 Z  s8 p( `end最大的系
. Z9 e3 }# j  n' D: g3 Q) H0 X& {% x. M$ b3 C
begin P_pick arriving
: w. ~- |( c" ^8 q* g    set A_i to procindex * 10 + 13 M$ n, z% e$ Y
    move into Q_induct(procindex)( s1 }) I/ i& d; k4 V
    move into pickaisle.induct(procindex)
3 L7 n! a9 N$ [9 h    /*check the type of pickaisle.induct(i), for your last problem.*/
) B+ f' |/ ^  v7 H
, n, F4 `% L, c# E: _    while A_i<=30 do begin
4 V6 W& A+ q" \! p# C' `, s( Y        travel to pickaisle.con(A_i)
% x' `' ]( `* m% A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ V9 E( [" H) ^( m7 |, U
        else wait for 10 sec
1 e) v3 Q. l. O/ k1 d        if A_i=A_leave then send to die
: d% D! X# k% ~- k' {% `. F+ {9 K        else inc A_i by 1
( @8 ~" Q4 ^9 ]2 H6 o2 J, X    end
4 z6 t: L. _' S: [; z, Vend+ H" G2 r& L; R3 C, i

% ^% u/ q; p+ P: S其中的procindex为整形,代表当前process的序号。
$ Z5 o7 c  q9 l, w4 o9 \station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2025-11-24 21:04 , Processed in 0.016398 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表