设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14574|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ B; p" V9 M" O6 j" W1 B* ~& A: X5 M' g' p/ |
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! f3 O1 n& `' o: v

* _* b3 B, h# P. ~7 bbegin P_read arriving
; k7 C) K/ l' }0 |* Q7 X& i9 @    while 1=1 do begin
' ~' {5 ]. i; q) h        read A_tote from "data.txt" with delimiter "\n"
1 J& W: A% e1 e: R% m        read A_time from "data.txt" with delimiter "\n"
$ B: c4 e9 |+ S: a: u6 T3 R' W# \) X        read A_leave from "data.txt" with delimiter "\n"
# o& {, o: w9 V4 q0 [        read A_picks from "data.txt" with delimiter "\n"
0 {/ L1 c* ]( q/ M) @$ }        set load type to A_tote
$ c' l; s) @* j. w$ O        if A_tote="tote 1" then set A_induct to 12 _1 X) S2 `6 g/ N( d
        else if A_tote="tote 2" then set A_induct to 27 \$ \) o! ]. [- j" \  g
            else set A_induct to 3    ! A* |9 U) z: S, X  n. d% }
        set A_i to 0
2 @# }& c4 h% J9 y* Y4 F        clone 1 load to P_induction
/ t# ]% O: e$ S        wait for A_time sec
3 i* t; D" S9 p) v  C  A    end3 _% `# I0 u! m
end
# Z! j+ B; N! Q; e& B% x' c( d
% g  j$ p; R- ?9 wbegin P_induction arriving. k6 I. A" [2 X3 I' V$ k
    if A_induct=1 then clone 1 load to P_pick1) `% x! K, S; S( W
    else if A_induct=2 then clone 1 load to P_pick2
" P! R4 G- t% M2 p7 @        else clone 1 load to P_pick39 E. V9 @, k" T. N5 {% ?
end
8 N; p) ?+ r5 w. X8 X1 i# p- V! p5 z9 w) e
begin P_pick1 arriving7 \' [0 F- K7 L
    set A_i to 16 n( P* H6 h9 l
    move into Q_induct1
  ^0 I* @" C5 |: ?) d    move into pickaisle.induct1
" L) B- V: g/ ]4 H! s) B# W7 P+ K    while A_i<=30 do begin
& w  P- J; T% _; @+ N& F, U        travel to pickaisle.con(A_i)
% d/ w% Q& w! S* F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 ~( X6 z; B% i4 P$ o" u+ U9 {  c
        else wait for 10 sec
  r  P; r) b1 c) x        if A_i=A_leave then send to die3 e4 B. \, g& e8 `3 G4 Y0 n" X
        else inc A_i by 17 H. ^; l" p1 j& m
    end
; |- z8 c  P) ^6 n* U. v% b5 }3 Uend
- G8 \9 Y- ~" e3 a, i( u! C' K8 j: p4 u
begin P_pick2 arriving2 i+ S2 Q- ~3 r7 G3 L' l
    set A_i to 11+ A7 g3 F/ R) J1 c& g! j
    move into Q_induct2; [6 S" M3 Y( L' f: f  `
    move into pickaisle.induct2! Y: ?* o2 I7 N2 }
    while A_i<=30 do begin9 J6 L' G$ @/ [9 v
        travel to pickaisle.con(A_i)9 `9 c" F$ _, V+ ]2 }- t* D+ V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& I2 ^5 V0 ]; _; b* a, ?/ w0 S        else wait for 10 sec$ f: s- z4 ~' M- x$ ~2 H3 k; d
        if A_i=A_leave then send to die+ ^0 F4 ?. ?/ J( y9 G* Y
        else inc A_i by 18 u; l6 r  g0 V; F* j
    end
6 N% F: U/ p4 k6 r+ m- A8 T+ ^end
, d$ Q: k! @; t) o  e* X$ m! P' i' k2 k; _
begin P_pick3 arriving
# B! e+ W/ I8 Z, Q    set A_i to 212 Q$ L  s- {6 h) K0 I+ j
    move into Q_induct33 W3 _! T9 B# ?9 j* s$ S
    move into pickaisle.induct3
& q$ a2 w: Q' B    while A_i<=30 do begin
! s: a' _3 D0 k9 B! g7 r        travel to pickaisle.con(A_i)
3 Q8 \' t7 h3 k' W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! `8 j" g; b- ^$ M
        else wait for 10 sec
# E. Z$ r/ F1 B, B% x, m) I' ^        if A_i=A_leave then send to die
7 m) p/ A' r" M+ h% [        else inc A_i by 1' E9 ~' c* Q- z4 ?
    end& T$ ~0 m! _' y8 w
end

最佳答案

查看完整内容

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是个什么东东?5 [. m# D; Y( g5 `/ @
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
* e) Z) P' Q+ f) x. e) Q- Y
- n/ b1 x+ _% g& W: Z6 i/ M% x- tAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; C+ [* U& E2 K4 c+ B6 P
( k3 z. z  t* o+ x' A* W4 k: t" \
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 D9 A7 c; @* K' y0 C( l+ p1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 Z) o: X" G+ f* j2 \- C6 Z2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' z; q1 s7 {9 o( x0 v. Z( k
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; G, m2 }% K! gbegin P_induction arriving8 j( F1 n+ m6 F! k' C  d2 X% {
    clone 1 load to P_pick(A_induct)7 _: _$ o& C7 q9 R1 I
end最大的系
8 H( K% K( a$ ?, v
- z$ A7 E$ @9 \0 |: X" ubegin P_pick arriving
& h3 w7 R' F# S6 y    set A_i to procindex * 10 + 1
( `6 s& \+ j- k6 h! J6 ~6 i    move into Q_induct(procindex)' v0 H7 Q' J3 w% H
    move into pickaisle.induct(procindex)0 }6 g# i; _. V7 f+ N
    /*check the type of pickaisle.induct(i), for your last problem.*/, w8 V9 m# K* j' ~% ?2 g
1 S0 T( @) a$ h' C- l+ q; c
    while A_i<=30 do begin# s! u5 P/ o2 s  I8 @1 m' l. \
        travel to pickaisle.con(A_i)7 J+ s; q) B+ V+ n' z1 U9 B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* i5 p, R" J- A5 L7 [5 j4 X        else wait for 10 sec
2 P/ B% I9 {) c8 _; b        if A_i=A_leave then send to die9 g+ w+ s2 }# H$ T5 e6 w
        else inc A_i by 11 b/ a/ y, q2 _: T4 Z( Q
    end" ]# b$ C1 H+ N& {' W8 e$ \
end- c- h, r; d. K  X/ H. o& V( }

: a+ Y7 B7 w. H! A3 I: e0 \5 L其中的procindex为整形,代表当前process的序号。
5 J9 N' C( q5 D* Bstation和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, 2026-7-17 15:35 , Processed in 0.019098 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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