设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15203|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; L( T* B1 V+ g2 ]$ q% Z
" Q- l5 v: J  c- Z+ }/ U$ F我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 ~2 {' q- Y2 a+ Q9 C
( y$ c/ u7 M: l5 g5 ^
begin P_read arriving/ i4 `5 s( Q' i+ e; c- z
    while 1=1 do begin
  A$ R( o! v; @5 f  q8 \        read A_tote from "data.txt" with delimiter "\n"7 G( O' W! n/ Y5 J* q5 F8 i
        read A_time from "data.txt" with delimiter "\n"
- I7 U% s6 e- r1 ?+ U  V4 O        read A_leave from "data.txt" with delimiter "\n"
/ ?9 W# r  C6 k- t0 V8 k4 _- y. w        read A_picks from "data.txt" with delimiter "\n": S8 D! ]. F1 Y4 I
        set load type to A_tote4 u1 z9 U% N) ~
        if A_tote="tote 1" then set A_induct to 1
' l: [  m" {/ d6 Z  }( F        else if A_tote="tote 2" then set A_induct to 24 h' R. y# |5 A  t
            else set A_induct to 3   
9 c8 g9 d2 z# s        set A_i to 07 d# K/ q* }- q) Q5 s4 \
        clone 1 load to P_induction
  b+ ]6 Q0 t: y7 f1 p+ q( j* P        wait for A_time sec' J* ?0 G! O9 T; s
    end
$ W7 R/ b" Q0 I5 `4 \# f$ M0 Mend
- P% I. j- C! D5 z. V
" c' B3 i/ l7 Tbegin P_induction arriving7 v! {* D) |7 a
    if A_induct=1 then clone 1 load to P_pick1
7 ?' }8 I. U7 U" x6 M* c. k    else if A_induct=2 then clone 1 load to P_pick2- t+ X! `6 h) r# {( F0 ^) K! ]
        else clone 1 load to P_pick3
" @$ M# e+ g7 \end
  {0 P2 _/ @/ \
# L+ }, E$ G; R& R; p+ W5 Sbegin P_pick1 arriving8 u% j/ ^/ h4 L" j6 s2 B( r, G. O- C0 X' X
    set A_i to 1
4 L1 M4 x9 o( V    move into Q_induct1$ i4 c1 P# @. d9 T2 M
    move into pickaisle.induct1
' E+ C+ x0 E3 g( Z) `2 v    while A_i<=30 do begin
/ l( z% M+ b- _' S, g4 r( H        travel to pickaisle.con(A_i)
& S: j# S8 l# A1 G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ x7 v3 k4 p% {# h
        else wait for 10 sec6 \- t- n+ Q* ]0 f9 O2 E+ L
        if A_i=A_leave then send to die9 G' e" j. J, A5 v! H
        else inc A_i by 1/ c* @1 ^" j* D! n* }& h3 h
    end
' ?2 z% x! p6 o+ k/ |* B$ Nend$ Z! X" q+ e* W3 y* P
# o# T9 e: P0 |4 w/ \& i
begin P_pick2 arriving
1 \1 |6 E9 X% j    set A_i to 11* g2 ?% g# w! |6 S! W/ u% o4 K
    move into Q_induct2
, i% {/ j+ s4 ?    move into pickaisle.induct2& k; o. d3 E* T; K/ b
    while A_i<=30 do begin' _- t1 q1 \0 Y  t! d
        travel to pickaisle.con(A_i)
! ]2 u2 N( Z5 B1 P+ P4 E% a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! E- U' f/ A  D3 T% Y
        else wait for 10 sec) O: E" s: x" o- w  W) y
        if A_i=A_leave then send to die" X1 r; _: W7 _7 v. C$ a) G6 @+ W
        else inc A_i by 1) r$ L- N. n; H8 G' h
    end
0 ^3 e( _' `3 U6 c, j" w% {end
" P) K' K/ L; H7 y- F. C0 s: v% U4 e0 Q" l5 v
begin P_pick3 arriving1 m  o# ?" l0 p
    set A_i to 210 e$ V- v* X3 h  O
    move into Q_induct3
7 S+ C$ F, ]% ]5 y* F& A! C    move into pickaisle.induct3; |3 q' e# q1 @! u- h* X7 y
    while A_i<=30 do begin/ h, [, Z: U8 j$ p# I
        travel to pickaisle.con(A_i)
6 W/ b1 u% D! I+ P* x: N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' E0 ?5 P' \8 J; h
        else wait for 10 sec
% e: r8 x" D% P: t3 M2 d1 m        if A_i=A_leave then send to die- ?* v9 z$ j  o7 b  @0 N! a# \/ s$ Y
        else inc A_i by 1
8 `+ g, _  a2 h    end
; z0 J$ U4 O* L& c+ u0 jend

最佳答案

查看完整内容

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是个什么东东?
& b" c: ^7 x$ b/ ]9 c  amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ F! W; b  s( z# W

3 v6 l8 q2 ~0 e4 b2 J! RAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ C# |- N. {$ V; V' n+ e
, q: k( V" @$ q! ~) B% f, E4 r
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 A8 c" q1 G6 e1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ L8 M+ ]. l' G1 Z5 ]2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, N6 ^* h8 F5 w
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, u5 V* ~: F  ]. D9 kbegin P_induction arriving! B  K8 O2 }7 b+ U. U4 u
    clone 1 load to P_pick(A_induct)
' _9 u- b' r; B# w+ s# g$ zend最大的系
& x5 c* P4 _: L9 A& G* O7 v% S2 @/ k. {& M3 f/ e7 Q5 ~
begin P_pick arriving
. o( h4 I& [7 x3 e6 N4 Y    set A_i to procindex * 10 + 1
4 @: k* a2 W" M5 i9 w8 N    move into Q_induct(procindex)
9 n8 i* c6 g7 ^' x$ P" P    move into pickaisle.induct(procindex)
$ T5 }& L  L& k2 s7 m    /*check the type of pickaisle.induct(i), for your last problem.*/" O/ E. m6 A7 P# o
% |  B3 ~4 u7 D. w  d
    while A_i<=30 do begin( b2 c0 M7 @' Q4 p- y! Q
        travel to pickaisle.con(A_i)
4 r5 q+ n- Q! n, m" K8 ~8 l9 h5 _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 G6 K8 R) ]7 f- b        else wait for 10 sec. ?6 Z# q4 ]- F! Y) x# E! o4 j
        if A_i=A_leave then send to die2 k) q. |; ^5 c$ U8 X, X8 H. d
        else inc A_i by 1
! R5 F+ r1 }1 i' I. L( ?" N    end' I8 X2 U' H9 k4 Z, V: `: Q
end9 H; Q1 m: v! B& ~; M: C

+ a2 y# e- \6 O$ u1 a% y其中的procindex为整形,代表当前process的序号。
/ y! T, u7 C/ S8 l/ [! wstation和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-8-23 04:14 , Processed in 0.016282 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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