设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14161|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 J6 ^3 {+ n+ x- _: u0 U2 F8 Y$ t% X( l, M# X# B& i
我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ H6 i# I% B& H) B3 P3 E$ T& X
, `) W: L, T+ e* }9 ~
begin P_read arriving
  d! V- h6 b) O1 b" I    while 1=1 do begin3 g8 g; C! M( }( l
        read A_tote from "data.txt" with delimiter "\n"& A: O9 x4 U' T5 |
        read A_time from "data.txt" with delimiter "\n"
2 h; l5 s7 E/ |. Y$ V/ f        read A_leave from "data.txt" with delimiter "\n"5 r- P9 v4 Z, {
        read A_picks from "data.txt" with delimiter "\n"8 }# \" X) W4 J# Y6 n& u, ?
        set load type to A_tote# z( ~! f; |* a3 o' Y
        if A_tote="tote 1" then set A_induct to 1
0 B" M. K: A0 C        else if A_tote="tote 2" then set A_induct to 2
+ w/ S* w+ u7 j) H, x            else set A_induct to 3   
% S0 p" M3 U* e+ m        set A_i to 0
+ z1 @9 Y* P" R        clone 1 load to P_induction
# A0 X* l- Q5 ?! M        wait for A_time sec
0 a8 Z' X7 U: }" q    end
: F; r1 m# |" M7 V* cend
  U7 _7 u" h7 X* V4 z0 `( E; N) M; ~0 M4 b, a! G/ C4 p4 z
begin P_induction arriving- K3 j) `; n8 K) X: X
    if A_induct=1 then clone 1 load to P_pick1
9 M7 j  E0 k5 a( b2 T    else if A_induct=2 then clone 1 load to P_pick2
; |! A3 M$ Y$ k' d' m1 ~0 Y6 `        else clone 1 load to P_pick3
1 I) j0 D5 z: f# rend# t/ ?( M: M1 b! D) K# W: j
0 O: L; p3 j  x3 F
begin P_pick1 arriving
; d9 d1 ~# M# v$ @" b" W    set A_i to 1
7 l9 x7 i* e, y* E9 ]+ U3 I* d9 `    move into Q_induct10 C! L: ]" H& g/ I6 Z( i) k
    move into pickaisle.induct1" P: Q1 D1 o, k8 r9 [! s
    while A_i<=30 do begin/ }4 N4 q# E+ _; x( F2 O8 r
        travel to pickaisle.con(A_i)- X8 {7 g, @/ N6 c0 O, q, `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: ]) f7 i' B2 k! ?6 z
        else wait for 10 sec
" d" I1 e0 n* z% J# u5 v0 p- f        if A_i=A_leave then send to die0 G3 R1 ^6 r; ~6 e1 M3 g# J5 L
        else inc A_i by 1+ v+ s- ]. c% g4 R
    end
  {& S9 w( S# r, Zend
% E/ ^* ~! N) D  ?2 m( o1 f4 b& X
begin P_pick2 arriving
/ r8 o3 n1 e2 b    set A_i to 11& a' @9 p5 P& U& G
    move into Q_induct2/ `+ h$ S0 K: n& P
    move into pickaisle.induct2
- x( v: j! G% A3 c# w    while A_i<=30 do begin
: @* {* `6 \# h* m( s        travel to pickaisle.con(A_i)
' ?" P: s8 e( b: W- I0 _+ K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 G2 b/ d  ?% b+ y9 M3 n
        else wait for 10 sec  a+ ?/ Y5 L) k6 W9 F3 ^
        if A_i=A_leave then send to die
1 b9 Z8 O2 x& b' o& s        else inc A_i by 1
0 V. i' ^, b" ^( j9 I) {) R    end
- {( d. ?+ o8 Tend
4 r8 p4 e" R% g& ^+ c2 L
; M9 a# X9 z7 ^0 @; |begin P_pick3 arriving2 M: j, S, x  r  |4 E( z! m. f
    set A_i to 21
4 L9 y4 r/ S% G' J+ v    move into Q_induct3
+ r3 W$ N0 H$ N# Z( ?+ h    move into pickaisle.induct3
0 @$ T! d9 E/ r5 g    while A_i<=30 do begin$ I+ Q! U6 u4 W' Z! a' Y
        travel to pickaisle.con(A_i)+ r% ~' {* R# q5 c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" {' ]- M2 _) S( L  N: l- Q
        else wait for 10 sec
: x& _  E! x. {+ R) @        if A_i=A_leave then send to die5 R  Y0 H' g7 S- f1 U4 g
        else inc A_i by 1( W1 J' A7 W: L7 H- V6 c% s7 h
    end
& E1 Z4 _& b* c% e3 y% m2 send

最佳答案

查看完整内容

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是个什么东东?7 u3 ~8 l6 X+ h
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
* ~, d1 J5 ?9 U3 Q, \6 I( p
! Z! \5 C/ ~: n% o# d6 OAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ B2 I" o+ h# H$ k5 `1 t2 O% r
- Y3 C- ]% m+ F( A
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  M; X& ~" T" l$ h4 Y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  n6 u6 u* c; k7 w6 ^1 W. S2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% j' u1 y6 F, W$ ?! q, f* M3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  P" v0 V2 Z* n6 pbegin P_induction arriving
: n5 D& W- M5 q0 Q; g$ m    clone 1 load to P_pick(A_induct)
# k3 m& t7 p% ~6 G& eend最大的系  E0 l# O3 o/ A' l' P

5 Q, y- Z( v: B" e2 Fbegin P_pick arriving
3 k) k2 f, P1 C% _    set A_i to procindex * 10 + 1
% x2 f/ R% z& j. Y) v- Z    move into Q_induct(procindex)0 k; y! y0 ?( i5 y, V6 s4 D% R$ }
    move into pickaisle.induct(procindex)
- _* j7 R+ J2 V* E1 G2 a    /*check the type of pickaisle.induct(i), for your last problem.*/1 N: i/ o. L# s

0 }7 ?  r" k9 _$ w$ j6 [1 L5 b    while A_i<=30 do begin
2 [7 D  Z% z- S1 `8 C6 f, K        travel to pickaisle.con(A_i)
. N0 m5 f7 @0 ^8 g( Z* |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; c. k  D( X. `+ v: i0 a( Q        else wait for 10 sec
9 q% [" E' ~! k  D        if A_i=A_leave then send to die7 _7 X* f+ {8 [. T6 \( r# l$ M
        else inc A_i by 1" b; u; b3 G. G. d3 O1 G! u
    end
2 u# U% w1 u. \0 |( Uend- }& |4 A5 h" J5 }: h) h1 i
0 h: l% B3 k. ^3 l- e, W
其中的procindex为整形,代表当前process的序号。  ?7 t+ J% r1 s+ O  ]5 R: j0 _$ v
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, 2026-6-15 23:47 , Processed in 0.015549 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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