设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15533|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* \0 W, K: d' g4 D. U
" [5 Z0 N' M) t3 Y% A1 r5 j# d8 w4 t我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: O1 J6 N9 y# D
- _- o  j: a1 X$ f0 q" Hbegin P_read arriving7 M4 c& c/ K  y/ i! S9 j* X
    while 1=1 do begin
) ~. E+ v! Y* B! |+ I# [        read A_tote from "data.txt" with delimiter "\n"/ H* m$ ]9 K; B  A5 r/ k
        read A_time from "data.txt" with delimiter "\n"
% P0 g# z' m0 f" Z3 [        read A_leave from "data.txt" with delimiter "\n"
3 J2 N2 y; Z* T+ x, W) ?' l0 w        read A_picks from "data.txt" with delimiter "\n"
/ }( G+ k0 \( f2 ^9 i        set load type to A_tote; D8 H, U4 ^7 x+ z
        if A_tote="tote 1" then set A_induct to 1% j! y; \' x/ C, F1 r1 [! w
        else if A_tote="tote 2" then set A_induct to 2
  h2 \" S/ k  t, I- }) T            else set A_induct to 3   
" C& \7 L9 F: @' e        set A_i to 0
# e" s0 j9 y$ Q6 G' P* M        clone 1 load to P_induction
1 X+ E2 y7 t* q4 m- W9 @        wait for A_time sec) J9 J! R( Y: m4 p' d
    end
# e3 A0 Q! Z+ d) p4 A7 q3 V% Oend/ Q6 p. i# v+ G

  L7 [& {9 A- O. v% V- Gbegin P_induction arriving4 s7 E6 P9 j' v" J( `4 x
    if A_induct=1 then clone 1 load to P_pick1
' s; R" |2 ~4 T& q! e% F; d/ e    else if A_induct=2 then clone 1 load to P_pick28 t$ j% t  A. Y2 G
        else clone 1 load to P_pick3
( a1 t/ h/ @5 R+ D! Tend
/ T( G' L( X1 T. P& m' L
% B; K: k3 k- k" Tbegin P_pick1 arriving
* i! w* c1 X( S" C, ~! m# L- |2 L: i2 h    set A_i to 1
. X/ ]6 ~3 V  n2 b4 G    move into Q_induct1
* w" O% \) e2 \2 r. Q3 W    move into pickaisle.induct1& ^" ?7 C, ?. S
    while A_i<=30 do begin
# v. j0 F  `. j5 l        travel to pickaisle.con(A_i)
/ Z' ?8 v3 e( }9 M% `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) P1 t, w- `. ]5 I  j9 b) G3 A        else wait for 10 sec
+ c9 O% m5 }+ X& \- A0 I' |% P        if A_i=A_leave then send to die
; @" e: g/ I7 d* B        else inc A_i by 1
9 k& M! W  f; `+ Q0 L* Z' p    end, E; h7 W- j8 I
end
- s# U0 f* o" D& U. `* \* g: z
, C/ h: q3 ?: A; J6 |- \begin P_pick2 arriving1 r: v. d' O5 f$ K6 n
    set A_i to 11
3 E" [0 F$ y4 z7 W# s5 H& j    move into Q_induct2, ^3 a' f" t" ~# x# z
    move into pickaisle.induct25 u! ?2 r1 \" r. c5 D' K& |/ F5 C
    while A_i<=30 do begin6 e+ s. F: D7 s) A  A; L# a4 m
        travel to pickaisle.con(A_i)
2 }! I: N1 b! s3 o+ \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. t8 H% x+ V  C- ]  U4 L
        else wait for 10 sec
, p6 K! h+ E0 O: E        if A_i=A_leave then send to die3 x. ^& h5 X$ ]% l
        else inc A_i by 1' G( l1 X6 F0 R2 C) p
    end
9 b& ~( L' z, G# t! bend
! \5 [; Z) U3 y+ k$ l; e! g. U# D8 z9 c* b& N- p( |3 Y
begin P_pick3 arriving# Z) [" J  A" K6 T
    set A_i to 21
' [5 y6 U* \/ M" U) C& O. [    move into Q_induct3
, {, d; x, H0 S: e3 V8 b/ w    move into pickaisle.induct3! z7 v# j. f5 P( r# I
    while A_i<=30 do begin
/ \  h/ [8 u& {  R7 s9 C2 J        travel to pickaisle.con(A_i)% s. o6 I3 |& d) [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ ^. I% ^. B% Y6 F5 x' J& D        else wait for 10 sec
  L% t+ K- u. t9 P' G. B/ x: B) j        if A_i=A_leave then send to die
0 E  B% Z; A! B# o$ Y        else inc A_i by 1
4 C( |/ B5 c* s, B    end
7 u) o- \+ p( B) c* S' N! a0 ?& qend

最佳答案

查看完整内容

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是个什么东东?
; k) |$ U# s2 n# T- ?+ f# Omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ @4 R9 X# y, t
  e) H# l0 p9 ^1 h+ Y) o+ a
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
  N7 W! J' t- s/ _1 f& y! Y. l
- i/ P+ U4 y' u* K另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 {* O' R9 w! N0 y8 I1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;1 ^" e; e6 D" S/ P
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 J7 h0 Q, }2 M- W4 g2 _5 k  k6 l3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 b  e3 Y. E  T4 b/ O
begin P_induction arriving
+ |* Q/ K7 B% n  G- [7 f& I    clone 1 load to P_pick(A_induct)
1 ^/ v) j4 X' z" [end最大的系, e5 o5 {- g$ }  ^+ @( L
* {; v0 R7 I6 ~7 w- z+ t  f
begin P_pick arriving/ W. f/ Y, D- k8 L* Q5 K! U6 j
    set A_i to procindex * 10 + 10 D3 E6 W% Q* v1 p
    move into Q_induct(procindex)2 F4 Y) I2 U1 M. r
    move into pickaisle.induct(procindex)
5 i1 y8 x7 i& y' j% L3 |3 F    /*check the type of pickaisle.induct(i), for your last problem.*/
* }' @$ `$ g) Q  h
: w8 o- E8 I9 H) F3 j8 Z5 B/ p4 R; \* o    while A_i<=30 do begin
. s- I: k! N! \9 z! |6 B* B. c! W        travel to pickaisle.con(A_i)0 S9 _2 ]2 }+ g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ v) d7 B9 l  B8 g( f
        else wait for 10 sec' r) N7 }- M# g3 R1 q# d
        if A_i=A_leave then send to die
9 N8 u6 q$ H5 Y% N) f        else inc A_i by 1; P: c( h. v( l  I% O0 U
    end0 {% i; m2 W. t4 L
end
; j3 R3 l' n1 q, _$ x
5 `- r0 ^1 H0 Y& W其中的procindex为整形,代表当前process的序号。
0 w2 c; n1 P: C/ }+ u; h; r2 ystation和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-9-18 07:05 , Processed in 0.017835 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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