设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14481|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 J2 T% ^/ ^! \8 d
; N( u9 b4 Q+ w5 i8 M! V3 {我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) ^2 @, Z# Y$ c( a, x$ Z# j
, U+ G( }3 X4 F# q9 `5 G; z; w& J- k3 Nbegin P_read arriving
2 D( q( D( k0 A' c* E$ W    while 1=1 do begin* G, Z4 N2 M! J2 c! i
        read A_tote from "data.txt" with delimiter "\n", a: X1 c* S1 t( c0 c
        read A_time from "data.txt" with delimiter "\n"
: J3 i2 }9 S# u! L& h& z        read A_leave from "data.txt" with delimiter "\n"8 r8 Q! \9 w( k" B8 x% n
        read A_picks from "data.txt" with delimiter "\n"
. S7 E& |  x# r7 _. V9 B        set load type to A_tote
4 M4 \' Q* X/ p+ ^" E/ w( H        if A_tote="tote 1" then set A_induct to 1( ~+ g! d8 p+ m5 v: n
        else if A_tote="tote 2" then set A_induct to 2
& K2 `3 g5 S6 k            else set A_induct to 3   
( z& A/ ]  k* l# g, W5 x& i/ z; F        set A_i to 0
, l3 B% r; S; l        clone 1 load to P_induction
, G) b& \! G, @  l4 \: I        wait for A_time sec! V. T4 ~/ P1 N' x' Z! h$ k
    end
+ G. V6 m& L5 V, R' Dend
9 L! t8 b" t& z) g- q! L5 I+ k+ |
3 X& H  }( X, U4 T0 x) Q1 X0 hbegin P_induction arriving
1 H6 T/ |$ N  O# R- T. T* E2 b    if A_induct=1 then clone 1 load to P_pick1
6 h, Y0 |; `3 B  q5 c( g" l  @' a$ _0 a    else if A_induct=2 then clone 1 load to P_pick2
* |$ f3 @" [, D        else clone 1 load to P_pick3
3 a4 N' @0 S+ d8 rend
/ m/ \- j- {; f5 L2 P  m! T- r5 t" t5 W# v7 P- l" K8 j& o
begin P_pick1 arriving: N$ D6 G4 H0 u- w: P
    set A_i to 1
2 j5 l, p! m% }* w9 u( i    move into Q_induct1
/ ?4 T+ `  M# Y    move into pickaisle.induct1
7 e8 Q! G% Y( v* g0 I    while A_i<=30 do begin
  U' n* q0 i( [* n        travel to pickaisle.con(A_i)! x9 D. [- A3 ^$ T! E* }; t. d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, s) |+ Z2 j0 P" M7 x: ?
        else wait for 10 sec
5 A0 ?  D3 b8 K        if A_i=A_leave then send to die9 m* d# b3 d7 o( q8 C
        else inc A_i by 16 y" j" C* g. i2 b# [9 U* S
    end
& X0 T2 L/ u% Q* B/ V6 lend8 r: l8 B# C: R9 `. E' ?
/ B/ T, G7 d. N2 J$ `+ ~
begin P_pick2 arriving
5 @' g9 ?9 d) F& d0 F7 l    set A_i to 11+ t6 X, p( a. k) D* x
    move into Q_induct28 h9 v# z) r  z, Q, Z, q  A" }
    move into pickaisle.induct26 N$ B3 a) N; b8 l: S8 W4 n
    while A_i<=30 do begin
. D- ^, ~3 t7 h# {+ x  w" x        travel to pickaisle.con(A_i)7 C' `0 M) J+ ~: b0 F5 Y; a8 J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* a8 }0 ^; c! I: \" D) A, D
        else wait for 10 sec0 l0 p. n% t& A6 |
        if A_i=A_leave then send to die
* c8 f3 h$ W& l% m. e; I# T        else inc A_i by 1
% d$ \8 B/ s& a+ s3 ^, g* a    end
! [) `- ?1 L2 z  ~- \3 y/ f2 m) A0 v% Gend1 D& ~& r; L; a7 i6 h3 M
$ i# {% h) M' |' ~$ j6 ?+ ]8 s& b
begin P_pick3 arriving
" @7 }5 H- ^  C% X: w    set A_i to 21$ K/ n$ b" g" m
    move into Q_induct38 m  ~& a6 A. H6 W5 m
    move into pickaisle.induct3
+ m" d" k+ M/ g; o    while A_i<=30 do begin
. t' |8 l, x) v: w        travel to pickaisle.con(A_i)
9 w7 R9 w: Y2 {0 D. O. s$ }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! Y9 J. R/ U$ }* I6 n        else wait for 10 sec
, \. _+ d1 _* p. v# S0 n        if A_i=A_leave then send to die
  f6 o" ]* i  ]( c# V& y        else inc A_i by 17 n8 Y7 }: Q8 L% V+ Q0 a% Q; D* G% w0 o
    end
2 S) H" [, |: _1 N5 n9 T2 bend

最佳答案

查看完整内容

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是个什么东东?
8 v; j9 w5 f4 v# p- Wmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
5 N, e1 [/ E' ~7 c2 h) C. I) M+ J  h
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! Q1 _* a4 i# f" E. u0 D3 @& R8 P4 W, _2 E7 w
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( \; s* _; R, z1 z3 Z+ \1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 h& V+ A+ z/ _
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: A# V& P1 K4 [7 L3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:" O  o3 Q, k. @' C6 T$ k
begin P_induction arriving) C$ w/ i# {; n" q0 }& c
    clone 1 load to P_pick(A_induct)& s9 m+ z' C5 c- I
end最大的系
0 H" F$ [3 {. M4 W# a" A# g( b' _" n: G& r) b. D/ q
begin P_pick arriving  a" }1 H+ s" E
    set A_i to procindex * 10 + 1
! m$ M* u$ x: v9 p    move into Q_induct(procindex)
! m( x2 _  a( u  B' d, ^& U    move into pickaisle.induct(procindex)
: W# F) ]5 J7 U( c% d3 Y# [. E    /*check the type of pickaisle.induct(i), for your last problem.*/
1 P2 }+ k6 T" _& g' }" m
" V+ F+ w- c" X/ G. K- {7 D    while A_i<=30 do begin
4 |. W- B0 z% J5 h3 w        travel to pickaisle.con(A_i). C6 o* g) d- _' S# o7 R0 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& y$ F$ c9 A: p: Q        else wait for 10 sec4 V5 K' U, q5 \
        if A_i=A_leave then send to die
2 ?$ K. K' x  [        else inc A_i by 1
0 D+ L0 v. W1 H    end' J$ W! Q9 W0 S9 g: [
end' K6 k7 V" v/ ^, J$ Q+ q4 o
- @- J, U' V: l% h
其中的procindex为整形,代表当前process的序号。
7 B7 i- o% Q  t, O0 _" K+ ^' {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-7-14 05:14 , Processed in 0.017122 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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